setting focus within a newly opened form

crowegreg

Registered User.
Local time
Today, 12:12
Joined
Feb 28, 2011
Messages
108
Within a form, I have a command button that I've written VBA code that works properly. What I'm needing to do is after this command button is clicked, I need to open another form, get some info from the user, then pass control back to the original VBA code.
 
Welcome to the forum.

I'm a little confused as to what exactly it is you are trying to do.

Could you step me through your process and explain what it is you want to do and achieve?
 
Let's see if I can make this more clear. Form A has a control button with VBA code behind it. What I need to do, is after the control button is clicked, I need to open Form B, get some info from the user, then pass this info to the VBA code within Form A. Right now, when I click on the button in Form A, form B opens, but the VBA code continues executing. I need to stop the VBA code, get the info from Form B, then continue running the code. Hope this helps!!
 
OK, I get that, what I'm try to determine is; what is it that you wish to do with the information that is being collected by form B?
 
Within the original VBA code, I have a query. It requires a date. Currently the query has an input box for the user to enter a date. I thought I would create a form, use the calendar function to make it easier for the user, then pass that date to the query.
 
OK. Instead of doing this with a pop up form, why not put an unbound field on your Form A with an associated calendar control?

Then when you press your button you can test the filed to ensure that a date has been entered, stop the code and prompt the user, or continue on and run your query, picking up the unbound field in your query using;
Code:
Forms!YourFomrName!YourControlName
 
I just figured that out. Thanks for working me through this!!
 
No problem, some times you get an idea in your head and it can be hard to visualise alternatives :)
 

Users who are viewing this thread

Back
Top Bottom