Issue with VBA code running when it shouldn't.

odin1701

Registered User.
Local time
Today, 01:56
Joined
Dec 6, 2006
Messages
526
I have two forms.

frmStartup
frmMain

The startup form just has a logo, db name, version, and an exit button. The code for the exit button is simply:

DoCmd.Quit acQuitSaveNone

The frmMain has all of the DB stuff for users. This DB has the option of using a local database if the user isn't connected to the server. When this form is opened, it checks if a table link exists, and if not, displays a message notifying the user that it is not connected to the server.

This message box is in the On Load event of the form.

Problem is that the message box appears again when you click on the Exit button on the other form. How can this be?

I've put a code break in, and it doesn't run this when I click exit when I have the code open - that's if I open it with the shift key. When I don't use the shift key, then the message appears a second time on close.

Any ideas?

I did stop it from doing this by closing frmMain prior to exiting Access. Just curious why this would happen in the first place.
 
Can you provide the db to have a look at because how you have explained it seems correct.
 
Can you provide the db to have a look at because how you have explained it seems correct.

It would be too much of a hassle to take the confidential stuff out really.

It's working a slightly different way (I updated the post to say that), but I was just curious how this could happen.

I compiled, did a compact/repair, searched the code for a duplicate piece of code that could have been pasted elsewhere....nothing.
 
Sorry I can not be of any help, it doesn't make sense to me, never come across it and without seeing it it would be hard to tell.
 

Users who are viewing this thread

Back
Top Bottom