Firstly, this is my first ever post on stack overflow, so I hope I'm following the correct procedure. I have browsed through dozens of posts on this and other websites but I can't seem to extrapolate solutions for similar cases to mine. I have also tried using debug lines, but I can't pinpoint the problem, probably due to the fact that I'm new to VBA. Here's what I have in short, I hope you can help:
A commandbutton on Sheet1 that raises a Yes/No/Cancel msgbox, I want a mechanism to remember this choice in the UserForms and Modules that follow, so I declared boolNieuweOpdrachtgever as a Public variable, however, in the subsequent form, the Debug line indicates that it doesn't remember its value at all. Here's the code:
Public boolNieuweOpdrachtgever As Boolean
Public Sub nieuw_project_Click()
Dim nieuweOpdrachtgever As Variant
nieuweOpdrachtgever = MsgBox("Text", vbYesNoCancel)
Select Case nieuweOpdrachtgever
Case vbYes
boolNieuweOpdrachtgever = True
Debug.Print "In nieuw_project_Click() boolNieuweOpdrachtgever = " & boolNieuweOpdrachtgever
nieuweOpdrachtgeverForm.Show
Case vbNo
boolNieuweOpdrachtgever = False
Debug.Print "In nieuw_project_Click() boolNieuweOpdrachtgever = " & boolNieuweOpdrachtgever
nieuweOpdrachtForm.Show
Case Else
Exit Sub
End Select
End Sub
For instance in the case of vbYes, it goes through a working form after which it goes into a second one that has an IF statement based on boolNieuweOpdrachtgever. However, by then it has already lost its value. Can you tell me what I am doing wrong?

