cricketbird
Registered User.
- Local time
- Today, 08:29
- Joined
- Jun 17, 2013
- Messages
- 117
When I open an Access DB, it it set to open a Welcome form which runs some code in the 'Form_Open' event. However, if the backend is offline, the 'Form_Open' code will generate an error. In my error handling to the 'Form_Open' function, I have it set to open the "Settings" form where the user can re-link the tables. The Settings window does indeed open as intended, but the Welcome form immediately opens again, hiding the "Settings" window and confusing my users. I think this is because the Welcome form's subsequent 'Form_Load' function has (otherwise necessary) steps that draw the focus back to Form A.
Is there a way to have Form_Open return an error that the Form_Load can use. e.g. if iserror(Form_Open) then do X, else do Y?
Or, what would the best practice be for code that needs to run on the Welcome form that requires access to the backend but also gracefully handles the situation of allowing the user to relink the backend when needed and then resuming running?
Is there a way to have Form_Open return an error that the Form_Load can use. e.g. if iserror(Form_Open) then do X, else do Y?
Or, what would the best practice be for code that needs to run on the Welcome form that requires access to the backend but also gracefully handles the situation of allowing the user to relink the backend when needed and then resuming running?