popup modal form - quest 3

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

   
100106-modal3.GIF
mytfeinAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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.

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
re d) ... acDialog overrides those settings.

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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.

mx
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
mytfeinAuthor Commented:
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

0
 
hnasrCommented:
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
         DoEvents
    Loop
    'other xx code
    Beep
 End Sub
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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.

mx
0
 
hnasrCommented:
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 :).
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
50%   try it.  Open Task Manager ... click the Process tab, sort by CPU Descending.

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Don't get me wrong ... I do use that occasionally.

mx
0
 
mytfeinAuthor Commented:
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
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"(now i wonder if a report can be opened acDialog in preview mode."

Yes.

mx
0
 
hnasrCommented:
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 :).
0
 
mytfeinAuthor Commented:
tx all, s
0
 
hnasrCommented:
Welcome, and good luck!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.