Hello all
I have a chunk of code that counts records in a few queries and whacks the answers into 3 variables.
The code then runs a macro which emails three reports.
Fairly simple stuff.
What I want to do is to reference the variables created, and only send emails in the macro if this variable is >0.
Ive tried just putting- [Forms]![Form1].[Countqry]>0 - in the conditional part of the macro - but it doesn’t recognise the object.
I could, of course, create three new macros with just the one email in each, and use the conditions in VB. Or I could move the emailing part into VB.
But I have quite a few emails going out, and this would be a pain in the neck to implement.
Anyone know how to reference variables in Macro conditions?
Cheers in advance
J
I have a chunk of code that counts records in a few queries and whacks the answers into 3 variables.
The code then runs a macro which emails three reports.
Fairly simple stuff.
What I want to do is to reference the variables created, and only send emails in the macro if this variable is >0.
Ive tried just putting- [Forms]![Form1].[Countqry]>0 - in the conditional part of the macro - but it doesn’t recognise the object.
I could, of course, create three new macros with just the one email in each, and use the conditions in VB. Or I could move the emailing part into VB.
But I have quite a few emails going out, and this would be a pain in the neck to implement.
Anyone know how to reference variables in Macro conditions?
Cheers in advance
J