Forms "returning" a value

  • Thread starter Thread starter Andre Beier
  • Start date Start date
A

Andre Beier

I have created a form for new entries for a database table.
On that form I have also created a button which opens a new form to do some
calculations. The final calculation should be returned to the main form and
put in a textfield.

I was able to do that with

Forms![Name]![Field].Value = Me.FinalCalc.Value.

However, I want to use the calculation form for other textfields as well. Is
there a way I can have a return
value for a form that is given back once the calculation form is closed
like:

Forms![Name]![Field].Value = OpenForm "Calc"

Thanks in advance

Andre
 
No, once a form is closed any values were lost. You could
either hold those values in global variables, or never
close your form, simply hide it by setting it's visible
property to false.


Chris Nebinger
 
You could also use the OnClose event of the form to assign the value back to the still open form that closed it. If however you may want to call the Form from several places in your system, then assigning it to a Global Variable enables you to pick up the value from the variable once control has passed back to the calling Form.
 
Back
Top