Hello,
I think this is a very simple question to answer and maybe I'm just missing something. I have created a userform with an OK button:
I have two options for the user to select a pattern, either "Straight" or "Brick", and a check to make sure that one of the patterns have been selected.
However, I'm having difficulty getting information from the userform to the code I need to use. I created a short macro to see what was going on and I got "False" values regardless of which option button I select.
The output from this is "False False". Why can't I get "True" values?
Edit:
So I just thought of this right after I posted, but I think I'm losing the values when I use the "Unload" command. Is there another method of closing the userform without losing the information?
I think this is a very simple question to answer and maybe I'm just missing something. I have created a userform with an OK button:
Code:
Private Sub cmdOK_Click()
If optStraight = False And optBrick = False Then
MsgBox "Please select a pattern"
Else
Unload frmPattern
End If
End Sub
However, I'm having difficulty getting information from the userform to the code I need to use. I created a short macro to see what was going on and I got "False" values regardless of which option button I select.
Code:
If frmPattern.optStraight.Value = True Then
MsgBox "Straight"
ElseIf frmPattern.optBrick.Value = True Then
MsgBox "Brick"
Else
MsgBox frmPattern.optStraight.Value & " " & frmPattern.optBrick.Value
End If
Edit:
So I just thought of this right after I posted, but I think I'm losing the values when I use the "Unload" command. Is there another method of closing the userform without losing the information?
Last edited: