W
Wayne Morgan
If the variables are declared at the form level (in the Declarations section
of the form's code module) they should be available to all procedures on the
form until the form is closed.
That said, there may be an easier way. Let the user make the entries
directly into the form's controls and use the BeforeUpdate event of the form
to verify the values that have been entered. You could create a pop-up form
to display the entries if you wanted something more complicated than just a
message box. If so, open the form with the acDialog window mode argument in
the DoCmd.OpenForm call. Have two buttons on the form that will set a value
in a hidden textbox on the original form. When you close the form, the
BeforeUpdate code will continue to run. Check the value that was set in the
hidden textbox and react accordingly. To abort the save, set Cancel = True.
of the form's code module) they should be available to all procedures on the
form until the form is closed.
That said, there may be an easier way. Let the user make the entries
directly into the form's controls and use the BeforeUpdate event of the form
to verify the values that have been entered. You could create a pop-up form
to display the entries if you wanted something more complicated than just a
message box. If so, open the form with the acDialog window mode argument in
the DoCmd.OpenForm call. Have two buttons on the form that will set a value
in a hidden textbox on the original form. When you close the form, the
BeforeUpdate code will continue to run. Check the value that was set in the
hidden textbox and react accordingly. To abort the save, set Cancel = True.