Hi I've set up a global variable "Action" using a module to track whether a user has clicked on a button on a form that i'm using as a message box.
I put "Dim Action As Boolean" in the declerations and defined it as False in a Public Sub.
The sub contains a Do While Action = False statement which works but I can't get a button on the form to change the variable to True and therefore break the loop.
In the forms module I have a button with the onclick event
Public Sub MyButton_Click()
Action = False
End Sub
But when you click the button it doesn't break the loop in the other module. Access would have thrown up an unidentified variable error if Action wasn't defined so I guess the variable is going to the class module it just isn't returning. Can anyone help, thanks, Tom.
P.S. Sorry I know there is a lot of stuff about passing variables on the site but I couldn't pick what i needed out of them!
I put "Dim Action As Boolean" in the declerations and defined it as False in a Public Sub.
The sub contains a Do While Action = False statement which works but I can't get a button on the form to change the variable to True and therefore break the loop.
In the forms module I have a button with the onclick event
Public Sub MyButton_Click()
Action = False
End Sub
But when you click the button it doesn't break the loop in the other module. Access would have thrown up an unidentified variable error if Action wasn't defined so I guess the variable is going to the class module it just isn't returning. Can anyone help, thanks, Tom.
P.S. Sorry I know there is a lot of stuff about passing variables on the site but I couldn't pick what i needed out of them!