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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top