macro conditions

clean32

Registered User.
Local time
Tomorrow, 08:18
Joined
Jun 28, 2016
Messages
36
i wish to run a macro only if the day matches

from a form with a date. if the day of that date is the 1st, then run macro. if not i assume it will step over to the next line in the macro. which will be the same but the 2nd, then 3rd and so forth
 
you'll need a series of IF's there in your macro:

IF Day([Forms]![yourForm]![field])=1 Then
...
...
End If
IF Day([Forms]![yourForm]![field])=2 Then
...
...
End If

... etc.
 
thanks, its an IF day, new one to me.

but if i leave the end macro blank will it just move onto the next line?
or do i actually have to have an end there. or will and end actually stop every thing?
 
if you want to Explicitly stop the macro you insert and the it inside the each IF's:

IF Day([Forms]![yourForm]![field])=1 Then
...
...
StopAllMacros
End If
IF Day([Forms]![yourForm]![field])=2 Then
...
...
StopAllMacros
End If
 
if you want to Explicitly stop the macro you insert and the it inside the each IF's:

IF Day([Forms]![yourForm]![field])=1 Then
...
...
StopAllMacros
End If
IF Day([Forms]![yourForm]![field])=2 Then
...
...
StopAllMacros
End If

got it working just needed

Day([Forms]![yourForm]![field])="1"

in general i attached the finished DB
 

Users who are viewing this thread

Back
Top Bottom