If Then and Gosub

PeterKegels

New member
Local time
Today, 12:52
Joined
Apr 19, 2013
Messages
9
If Me.Day <> Me.Till Then
GoSub Calc1
Else
DoCmd.RunMacro "M_Roombooking", 1
DoCmd.RunMacro "M_Vernieuwen", 1
End If
Exit Sub
Calc1:
DoCmd.RunMacro "M_Roomsfree", 1
Return

The meaning is that the Macro "M_Roomsfree" repeat himself as long Me.Day <> Me.Till.
In this case the macro repeat himself just once.
Me.Day is 13/05/2013
Me.Till is 16/05/2013
Means that this Macro has to run 3 times before he runs the other 2 macros.
Something wrong over here?
 
does one of your macros increment the day?

if not, it will run forever.

(and watch for me.day and me.till being the wrong way round, as that will cause the same problem.)
 

Users who are viewing this thread

Back
Top Bottom