My application has a data entry form with a “RETURN” command button that unloads the form and returns the user to the main “dashboard”.
Before those actions are allowed to execute, the data is sanity checked. I do this by showing a form frmSanityCheck that performs five sanity checks and displays the results on-screen. I have a public boolean variable bSanity that is set to “True” if the data passes the sanity checks, “False” otherwise.
Data Entry Form;
If bSanity = True Then
Sanity Check Form:
bSanity = True
‘--- do the checks
‘--- possibly setting bSanity = False
‘ Returns to Data Entry Form
Question: How does the cmdReturn sub in the Entry Form know to wait for frmSanityCheck to unload before checking the value of bSanity?
Is there a better way to do this?