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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Modal Form 1

Status
Not open for further replies.

thebigcheese

Technical User
Mar 19, 2001
10
CH
I have been having a problem with a modal form.

The form is activated via a module, which in turn is activated via a button on another form.

The form itself collects file name and directory locations used by the DIR statement in order to check the existence of input files necessary for the rest of the module. The form is both modal and pop-up, so that the user is given the chance to edit the data each time the procedure is run.

The problem is this:-
When I first open the DB and run the procedure, the form pops-up and the user is prompted for file location etc.
The procedure works well - the first time it is run !

When the procedure is run again, the form is opened, but instantly disappears, which means the user does not have the opportunity to edit the data - the rest of the procedure then runs.

If I close the DB and re-open, the procedure runs perfectly the first time it is called (ie the form pops-up with focus, but then disappears.

Any ideas?
 
How are you opening the modal form in code? Are you using DoCmd.OpenForm with the acDialog argument, or instantiating a new form object?

How are you closing the modal form? Do you have any wait loops?

Please could you post the relevant bits of code.

What happens when you step through the procedure the second time? This will help you find out exactly where the form is being hidden/closed unexpectedly.
 
It sounds like you have a variable or value that you need to reset. Maybe a loop or an if condition that allows the use out of the dialog box. See if you have anything like that. Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Thanks Terry and Rob for your advice,

I actually inherited the db (and the particular form in question) from a colleage. The code for the exit button on the form was not closing it properly.

When fixed, my code worked every time.
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top