how to declare a boolean variable project wide

S

Steve G

I want to set a boolean variable to be used for all forms in the database.
How is this accomplished?

thanks!
 
A

Allen Browne

1. Click the Modules tab of the Database window.

2. Click New. Access opens a code window.

3. In the General Declarations section (top, with the Option statements),
declare your variable, e.g.:
Public gbInit As Boolean

You can now use bgInit anywhere in your application.

You do understand that when you are testing, and you reset your code, that
all globals are reset, so this variable will become False again?
 
Top