If you open the pop up form as modal mode you cannot click out of the form until you close it. You do that by using the acdialog argument of the docmd.open form
DoCmd.OpenForm formName, , , , acFormEdit, acDialog
Here is a very good explanation
WHAT IS A POPUP FORM?
it's simple. it stays on top of other MS Access windows. that's about all.
here are some things you CAN do when a popup form is open:
*1) Manipulate portions of other MS Access windows that are visible. including the ribbon menus, any custom menus, and navigation pane / database window.
*2) Use VBA code to manipulate any other open object
Items with a lower Z-Index than a popup form
*1) Any windows that appear via the buttons and options that are on the HOME and CREATE menus in 2007 (and equivalents in earlier versions).
*2) Non-popup objects
*3) Other popup windows opened previously to the current popup form
*4) A Modal window that has been opened.
*5) The navigation pane / database window
Items with a higher Z-Index than a popup form
*1) 2007 Ribbon Menus / Menu Bars
*2) Any windows from menus other than the ones listed in item #1 above.
*3) Other popup windows subsequently opened.
Popups are useful sometimes. Here are some good uses of them:
*1) Stop the user from clicking around at will when they're supposed to be focusing on the current form.
*2) Get the attention of the user.
*3) Indicate to a user that there is something to do with the form on screen before anything else is done.
WHAT IS A MODAL FORM?
this is not so simple, but still easy to explain. a modal form simply freezes everything else on screen except the form itself. in other words, everything on screen other than the modal form and it's children items are inaccessible (this includes the navigation pane / database window). popup objects that still appear on top of modal forms on the screen are also inaccessible, even through they're "on top".
here are some things you CAN do when a modal form is open:
*1) Manipulate the modal form
*2) Access menu bars and ribbons
*3) Use VBA code to manipulate any other open object
Items with a lower Z-Index than a modal form
*1) Non-popup objects
*2) Navigation pane / database window
Items with a higher Z-Index than a modal form
*1) 2007 Ribbon Menus / Menu Bars
*2) Any windows that appear via any menu bar option or ribbon menu item.
*3) ANY popup object, regardless of when it was opened
Modal forms are rarely useful (without being coupled with the "popup property). But, they do serve some purpose...like:
*1) Stops the user from clicking anywhere outside the modal form and having something happen on accident.
*2) when they're maximized. this plainly tells the user that something should be done with it.
USING MODAL and POPUP properties TOGETHER
in my opinion, this is by far the best option if you're gonna mess around with either of these properties at all. and here are some good reasons why:
*1) objects like this ALWAYS have the highest z-Index of all objects that are open.
*2) besides being on top, they also freeze everything else on screen, regardless of properties that are set on other objects.
*3) they are by far the best way to tell the user what to do when you have a lot of "submenus", and forms on top of forms that need to be opened to perform tasks that are buried deep inside the program.
*4) they get more attention (in my experience) if coupled with the "autoresize" and "autocenter" properties.
If you call the form to open using acdialog code execution stops in the calling form until the popup form is closed or hidden. So you it is difficult for the form that calls it to "grab" a value from the popup. You can do what you are doing and have the pop-up "push" the value back to a control on the calling form. That design is less flexible because you have hard-coded the popup and it cannot be easily reused. In other words another form in the database could not call it. Also you cannot pass the value back to the code that called it because that code is stopped, but you could pass it back to a control on the form.
If you are pushing the value from the popup to the calling form you can simply use "acdialog" argument and it will work. The form will popup and you will be forced to click a button. It will always have focus until closed. You do not have to use the code I provided.
However, imagine I want to call a popup from many different forms. Lets say it is a Custom calendar. You simply want to get a date and then do something with it. On the calendar there is only code to store the selected value on the popupform, and buttons for OK and cancel. Cancel closes the popup and OK makes is invisible. I can then get a value from the calendar by doing something like this is the calling form
Private sub SomeProcedureOnCallingForm()
dim SelectDate as date
'some code here
SelectDate = getValueFromPopUp("frmCalendar", "txtBoxSelectedDate)
'You call the function and when the function calls the popup form the code stops until the popup is closed or hidden
'If it was hidden the value is returned above and code will continue
'now you could do something with the returned date
Msgbox SelectDate
End sub