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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Button Problem

Status
Not open for further replies.

henley12

Programmer
Mar 26, 2004
17
0
0
US
I have a form with a command button to generate work orders. When this button is clicked, it is to open another form so the user can choose a date for the work orders to generate through, then perform the routine to add a record to the table, generate the next date, add the next record, and so on until the scheduled date is greater than the datethrough date.
The problem is it doesn't return the datethrough date from the date form so it can perform the routine. Any suggestions?
 
did you step through your code to be sure exactly what data if any is being passed. Are you referencing the datethrough date correctly (Is it passed between the two forms?).
 
I have an OK button on the second form that returns the value to a field on the original form. I think perhaps the problem lies in the fact that I am trying to do all of this in the click event of the original form's button. Is there a way to pause the execution of the click event to open the other form and return the value, then process from there? Or should I be approaching this another way?
 
If you make your second form a PopUp, the code on the command button should stop processing until you close the popup form.


Randy
 
With out seeing your code we are just guessing, but if you open a form as dialog the code execution stops from the form that opens the dialog form until the dialog form closes. You can set a global variable from the dialog form. So your order is

from form 1 open form 2 as dialog
set value of global variable from form 2
close form 2
continue code in form 1
use global variable in form 1 code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top