popup modal form - quest 3

Posted on 2010-01-06
Medium Priority
Last Modified: 2012-05-08
Hi EE,

In a prev related post, Databasemx began explainin to me what open a form using acDialog does.
From what i understand, it pauses execution in the "main parent" form that is doing the open.

ok, so i am a little puzzled, so i'd like to ask basic questions:
     a) Notice that there are 2 properties in design mode in the screen shot below
            1) popup - is that for POSITIONING the form
            2) modal - is that for main form WAITING on popup form to close for main form to continue execution
     b) if we use the above properties, do we also have to open the form acDialog
          or are they diff. techniques that do the same thing?

     d) notice in the screen shot below, that i just checked off popup as yes, and modal as no
          1) what is really happening bec. modal is no?
          2) should popup and modal both be set to yes?
          3) what situations would popup=y, modal =n
               what situations would popup=n, modal =y

your advice/ideas are appreciated, tx, sandra

Question by:mytfein
  • 7
  • 4
  • 3
LVL 75

Accepted Solution

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 26193130
The only way to stop code executing is to use the acDialog in the OpenForm command.  Set the Form's Modal and Popup to Yes does not do this.  So, when you need code execution to stop ... you need acDialog.

There is a 'trick' to set the Modal and Popup to Yes ...and then open the Form normally, but ... no need in this case.

LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 26193142
re d) ... acDialog overrides those settings.

LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 26193161
a) -1   No
a) - 2  No.

Without having to repeat it here ... the Help file on Popup and Modal and how they interact with each other is pretty good.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 26193417
tx mx, i went to help, and it was an excellent recap of the help that you provided.
it helped that you helped before i read help so tx for your help, s

help info on popup modal dialog concepts:
Note  If you want to use a form as a normal form as well as a dialog box, you can use the Dialog setting of the OpenForm action to open the form temporarily as a dialog box instead of using this procedure.

Set the Window Mode argument of the OpenForm action to Dialog (acDIALOG for an event procedure).
When you open a form that has its Window Mode argument set to Dialog, Microsoft Access sets the form's PopUp and Modal properties to Yes until the form is closed.

Note  Setting the Window Mode argument to Dialog disables user-defined key combinations and some other Microsoft Access function keys, and suspends the macro or event procedure until you close or hide the form. You can hide a form by setting its Visible property to No using the SetValue action.

 Create a dialog box  
Show All
Hide All
You can create a dialog box by creating a form and setting certain properties to make the form function like a dialog box.

Create a form and add the controls you want on the dialog box to the form.
Open the form in Design view (Design view: A window that shows the design of these database objects: tables, queries, forms, reports, macros, and data access pages. In Design view, you can create new database objects and modify the design of existing ones.).
Double-click the form selector (form selector: The box where the rulers meet, in the upper-left corner of a form in Design view. Use the box to perform form-level operations, such as selecting the form.) to open the property sheet (property sheet: A window that is used to view or modify the properties of various objects such as tables, queries, fields, forms, reports, data access pages, and controls.).
In the Pop Up property box, click Yes.
In the Modal property box, click Yes.
In the BorderStyle property box, click Dialog.
In the RecordSelectors property box, click No.
In the NavigationButtons property box, click No.
In the DividingLines property box, click No.
Create a macro or an event procedure to open the dialog box.
Attach the macro or an event procedure to the form by specifying the macro name or event procedure as the setting for the appropriate event property. For example, type the name of the macro or event procedure in the OnClick property box of a command button.
To position a dialog box on the screen, open it in Design view, maximize the Microsoft Access window, position the window where you want it, and then save the form. The dialog box will appear in this location when it is opened (assuming the AutoCenter property is set to No and you haven't specified its position in the event procedure that opens the dialog box).

 See Also  
Buy Microsoft Office 2007
Free trial of the 2007 Microsoft Office system
Was this information helpful?  

Please tell Microsoft how this information was helpful (optional): Please tell Microsoft how we can make this information more helpful (optional):
Please tell Microsoft what you were trying to do (optional):

Your feedback is being submitted.  

Thank you for submitting your feedback to Microsoft.  
Change my feedback  
Although Microsoft cannot respond to every comment, we do use your feedback to improve the information we provide.  
Do you need support, or do you have a suggestion about a product? Contact us.  
Contact Us
Privacy Statement

LVL 31

Expert Comment

ID: 26193686
One way to postpone execution of part of code:

Form xx_PopUp opened from form's xx Open event. It is set to Modal and PopUP

Private Sub Form_Current()
   DoCmd.OpenForm "xx_PopUp"
    Do While CurrentProject.AllForms("xx_popUP").IsLoaded
    'other xx code
 End Sub
LVL 75
ID: 26193738
That was the 'trick' I was referring to.  But, it's a big hit on processor time ... for Access.exe ... continual looping ... about 50% of CPU resources.

LVL 31

Expert Comment

ID: 26194228
1 Even though! 50%, which I am not sure if accurate, of just a few moments to log on :D. That is not much!
2 I was referring to Form_Open.
3 That was a way, if needed, time and money will be secondary :).
LVL 75
ID: 26194248
50%   try it.  Open Task Manager ... click the Process tab, sort by CPU Descending.

LVL 75
ID: 26194257
Don't get me wrong ... I do use that occasionally.


Author Comment

ID: 26194385
Thx hsnar,

I've seen that technique with opening a report in print preview.... did not realize that it could be done
for forms...

(now i wonder if a report can be opened acDialog in preview mode... have to go back to help, think
i saw some info in help on popup modal for reports....)

tx guys, s
LVL 75
ID: 26194414
"(now i wonder if a report can be opened acDialog in preview mode."


LVL 31

Expert Comment

ID: 26194419
This reminds me of the big sale: 10 - 80%. 80% of the very cheap stuff! It won't save you much!
Thanks for the info :).

Author Comment

ID: 26194631
tx all, s
LVL 31

Expert Comment

ID: 26195140
Welcome, and good luck!

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question