How to return value from forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is there a general technique for returning user selections/results from a
modal form? E.g. how can I determine if the OK or the Cancel button was
pressed?

Best regard,
Bertrand
 
One technique is to set a global variable when one of the buttons is
pressed -
before you close the form.

Another (if you want to retrieve more than just a single value from the
form) is to set the form's Visible property to True instead of closing it.
This returns the code execution to the calling form, but the modal form's
control values are all still available (Forms!MyModalForm!MyControl.value).
If you do this, be sure to close the modal form again after you've retrieved
the values you want.

HTH
- Turtle
 
Back
Top