Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could this be a bug! Has anybody seen this one before?

Status
Not open for further replies.

Savil

Programmer
Apr 28, 2003
333
EU
After several years of Access, VBA, Blah, Blah I thought I new a fair amount but has anybody noticed this one before.

I have an autoexec macro which calls a function, there is also an Access generated switchboard in the db. A text box on the switchboard is reliant upon a global variable being set in the Autoexec on the switchboards open event. The variable appeared to be losing it's value but after inserting several stops and following the code it appears that the switchboard event is firing before the autoexec called function.
Am I missing a trick here or does the documentation say to set the startup environment use the autoexec macro unless you have a switchboard.

Your views would be very much appreciated.

PS hopefully somebody can replicate it then I will know it's not just me.
 
If you open your form from the Autoexec macro instead of the startup, you shouldn't have this problem. Just make sure you don't open the form before the code that sets your variable runs.

Good Luck,
Shane
 
Shane,
I understand your solution to this problem but it does not hide the fact that some code has the ability to take precedence over whatever is called by the auto exec. This goes against every bit of literature I seen on Access.

Undocumented features, don't you just hate them!

Regards
Savil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top