LarryDeLaruelle
Technical User
I am trying to set up a user form for report production and want a public variable that will be the Message Box Title for all displayed error messages. I have declared the variable as:
Option Compare Database
Option Explicit
Public strTitle As String
strTitle = "Medical Reports"
This seems to work fine until I add an On Open or On Load event (to set the enabled/visible properties of various objects). As soon as I do and try to run the form I get a message:
"The expression On Load you entered as the event property setting produced the following error: Invalid outside procedure."
When I click on OK it still loads the form.
The curious thing is, I haven't put any code in the On Load event, just added it from the Properties Event tab.
Any idea what I am doing wrong here?
Thanks.
Option Compare Database
Option Explicit
Public strTitle As String
strTitle = "Medical Reports"
This seems to work fine until I add an On Open or On Load event (to set the enabled/visible properties of various objects). As soon as I do and try to run the form I get a message:
"The expression On Load you entered as the event property setting produced the following error: Invalid outside procedure."
When I click on OK it still loads the form.
The curious thing is, I haven't put any code in the On Load event, just added it from the Properties Event tab.
Any idea what I am doing wrong here?
Thanks.