I am attempting to open a form with a function in a module, use the form to get a starting and ending date which are both global variables, from the user and then continue in the function to load a table based on the two dates.
My problem is that the function does not wait after I open the form, which is modal. How do I get the function to wait? To open the form, I use the code: DoCmd.OpenForm "Form1"
One tip that might save you some time. When you use acDialog to open a form, execution of the code after the call will begin when you close or HIDE the form. Whenever I use a form to get user input, I will hide the form, then add some code after the OpenForm to get the data on the form (by referencing the Forms collection) and then have the calling code close the form when it is done.