I have a form F_SelectDeck whose function is to allow the user, by interacting with the form, to set the value of a global integer DeckSelected. By itself the form works properly. I was under the impression that if the form's modal property were set to yes, then after calling the form the code after the code which called the form would not execute until the form was closed. Evidently this is not the case.
I have the following code.
Sub SelectDeck()
DoCmd.OpenForm "F_SelectDeck"
End Sub
Sub Test09()
SelectDeck
MsgBox "The Deck selected was " & SelectedDeck
End Sub
When I run Test09 I immediately get the message "The Deck selected was " followed by the original value of SelectedDeck, which is not what I want. What I want is for program execution to not continue until F_SelectDeck has been exited. The modal property of F_SelectDeck is set to yes.
How might I get the program to operate as I want it to?
Thanks in advance.