Rick Brandt said:
Customer form passing a return parameter.
I believe I misinterpreted what you were looking for in my first response.
If you want the equivalent of a MsgBox where your code in the base form
calls the popup box and has its code paused until the popup is responded to
and then you want the code to continue with an additional piece of
information provided by the popup then this is what you can do...
First off, using a modal form is not good enough. While a modal form grabs
focus and won't let go unless you close it, it does NOT cause the calling
code to pause. For that you need to open the popup form using the acDialog
argument of DoCmd.OpenForm. Then to get the information from the popup
back to the calling code you can do one of three things.
1) You can have the popup form push the information into public variables
where the calling code can retrieve it.
2) You can have the popup form push the data into hidden controls on the
calling form where the calling code can access it after the popup is
closed.
3) You can store the data on the popup form and only hide it rather than
close it. Hiding the form will also allow your calling code to continue and
it can then grab the data from the popup form and then close it.
The third option is the one I use. The popup would typically have an [OK]
and a [Cancel] button. [OK] hides the popup and [Cancel] closes it. Then
my calling code can test to see if the popup form is open immediately after
the line of code that opens it. If it is still open I know the user
pressed [OK], otherwise I know they pressed [Cancel].