Pop up, Modal and what else stops code until form closes?

M

M Skabialka

Access 2007. I am using a sample template from MS for a project database.
Some of the forms were pop-up or modal but I have removed that property on
one form. I then created code to open that form to a record based on a
combo selection. The next line of code tells it to go to the second tab on
the form, BUT...
The code stops as soon as the form is loaded to the correct project, but
does not proceed to the line telling it to go to the second tab until the
form is closed, but then it is too late.
What other property besides pop-up and modal would cause this?
Mich
 
B

Beetle

It's possible that the form is being opened in Dialog mode, which is done
in code. Check the code for whichever event opens the form and see if
it says something like;

DoCmd.OpenForm "FormName", , , , , acDialog
 
R

Rick Brandt

You are opening the form using the acDialog argument I'll bet. That
overides and default mode and turns on PopUp and Modal. Modal is the one
that stops the code and PopUp makes that form stay on top of all of the
others so you can see it.

Modal does not stop running code on its own. All it does is prohibit any
other form or report from getting focus.

acDialog opens a form as if its Popup property were set to true (though
it won't return true if you poll it), and as if its Modal property were
set to true (again, polling the property will not return True), and also
adds the behavior of pausing the calling code that opened the form until
the form is closed or made hidden.

No combination of Popup and Modal will produce that behavior if the form
is not opened with the acDialog argument.
 
M

M Skabialka

Sometimes using a MS template can throw a real wobbly in the mix. The
acDialog was there as you suggested and was the cause of the problem, so was
removed. The form now opens and jumps to the second tab as required.
Thanks,
Mich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top