Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop up form

Status
Not open for further replies.

JonoB

Programmer
May 29, 2003
147
GB
Hi,

I have a command button on a form that runs a whole bunch of code (such as a few sql inserts, filecopy, etc) - lets call this Procedure A.

About half way through running procedure A, I want to halt and a small pop-up form to be opened. Once the user has populated a few fields on the pop-up, the pop-up will be closed by the user and Procedure A will continue running (referencing the variables and selections made by the user in the pop-up).

I obviously know how to create the forms, etc, but I would like some pointers on if what I have described above is possible (i.e. halting the procedure, getting more variables and then continuing).

For reasons which are not necessary to describe, I cannot first open the pop-up and then run all my code.

Any help appreciated.
 
Your popup modal form should either populate global variables or a parameter table in order your procedureA may retrieve the values entered by the user.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
OK, I am with you when you say that the poup should populate global variables.

However, will the code in ProcedureA stop whilst modal popup form is opened, and then only continue (using the global variables) when popup is closed?
 
If the form is modal, then yes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Would it also work to use InputBox once for each variable?

Based on PHV's level of expertise, I'm guessing that PHV's suggestion is better than this one, and I'm not even certain my idea would work - but I wanted to throw it out there...
 
I dont see why not....I assume that an inputbox is also considered to be modal?

It wouldnt work in my case, as I have a few combo's and listboxes on my popup.
 
Hi!

If the issue is still open, check into the acDialog arguement of the openform method of the docmd object.

[tt]docmd.openform "mypopup",,,,,acDialog[/tt]

which halts code execution in the calling form until the pop up is closed, so for instance if your variables are declared as form publics in the calling form, you could address them from the popup with something like this:

[tt]forms("frmMyCallingForm").strMyString = <my combo?>
forms("frmMyCallingForm").lngMyLong = <some long?>[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top