Before Form_Load

d_rool

Registered User.
Local time
Tomorrow, 06:44
Joined
Jun 10, 2008
Messages
11
Hi Guys

Is there an event fired as soon as I open the db even before Form_Load? Probably it is possible to do it with a module. I want to put some code inside to load a default form and disable the ribbon etc.


thx
 
Would be great if you could describe a little bit in more detail.
 
Go to the Macros tab on the database window and create a new macro called "Autoexec". You can do all kinds of stuff with it, but since I don't use macros I can't tell you how.

Alternately, you can just set a default form to start and put your code in that default form's On Open event, if you prefer VBA.
 
I use the AutoExec macro to load a hidden form and then use the OnLoad and OnUnload events for all kinds of housekeeping chores.
 
I use the AutoExec macro to load a hidden form and then use the OnLoad and OnUnload events for all kinds of housekeeping chores.

Out of curiosity, how is that better than specifying that form as startup form? Will it always guarantee that this form open regardless what?
 
Actually I've been unsuccessful in getting a form to open hidden any other way.
 
Ah, thanks for sharing.

My method was simply to open a form that users would actually interact then on its Open event, open another form but hidden. Worked okay for my needs, as I was too afraid to touch macros after a nasty experience with one.
 
Macros in Access scare me. Not because of anything bad that might happen but because they're an unknown. When I started working in Access from an Excel background, I was surprised that a macro <> a macro.

That's why I would always tend to use a startup form.
 
My system had no opening form, just a menu bar so I had to find another way. The AutoExec macro is to only macro I've ever used. It is code all the way for me.
 
That would indeed make sense in that scenario. Too bad we didn't have Application-wide events or we wouldn't be having this discussion.

But you gotta do with what you've given. :)
 

Users who are viewing this thread

Back
Top Bottom