Opening forms as a dialog box.

G

Guest

I have a form displaying records from several tables and queries and at one
point I want to open a second form displaying a choice for the user. I want
execution to halt until the user makes a selection and then to close the
second form and continue execution depending on the choice made. Sounds
simple.
My problem is the code doesn't stop executing and ends up in a loop which
stops the second form from displaying. If I put a break in the code the
second form displays. The second form opens in modal, pop up and dialog
border. This stops focus from transfering to another object but it doesn't
hold the execution of code.
How can I make my code wait for a response from the second form?
Thanks
Paul
 
F

fredg

I have a form displaying records from several tables and queries and at one
point I want to open a second form displaying a choice for the user. I want
execution to halt until the user makes a selection and then to close the
second form and continue execution depending on the choice made. Sounds
simple.
My problem is the code doesn't stop executing and ends up in a loop which
stops the second form from displaying. If I put a break in the code the
second form displays. The second form opens in modal, pop up and dialog
border. This stops focus from transfering to another object but it doesn't
hold the execution of code.
How can I make my code wait for a response from the second form?
Thanks
Paul


You don't need to set the form to either Pop-up nor Modal for this.
You do need to open the second form in Dialog.

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

On the second form, you need to have a command button to either close
the form (DoCmd.Close acForm, "FormName") or make it not visible
(Me.Visible = False).
When you then click on this command button, the form will close or
become not visible. Then processing will continue.
If you choose to make the form not visible, remember to then make it
visible (forms!FormNam.Visible = true) again when your code is done.
 
G

Guest

Thanks Fred but I actually have the opposite problem.
I open the form with

DoCmd.OpenForm "frmMatchPlayers", acNormal, , , , acDialog

I have two command buttons, the choice the user makes. The click event for
each does someprocessing and assigns values and then closes the form. The
problem is the processing on the calling form is not stopping but continues
before the user makes their choice.
 

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

Top