Userform change question

  • Thread starter Thread starter Patrick C. Simonds
  • Start date Start date
P

Patrick C. Simonds

I have a UserForm on which I have placed an OptionButton Group (Mr, Mrs, Ms,
Dr) and OptionButton Group (Male, Female). What I would like to have happen
is that when I select Mr, Male OptionButton becomes true, Mrs or Ms, Female
becomes true. If Dr is selected I want nothing to happen and then the user
will select the correct gender.
 
Hi Patrick

Try something like:

'=============>>
Private Sub optMR_Click()
optMale.Value = True
End Sub

'--------------->>
Private Sub optMRS_Click()
OptFemale.Value = True
End Sub

'--------------->>
Private Sub optMS_Click()
OptFemale.Value = True
End Sub

'--------------->>
Private Sub optDR_Click()
optMale = False
OptFemale = False
End Sub
'<<=============
 
Similarly, you could try this:

Private Sub obMr_Change()
If obMr = True Then obMale = True Else obMale = False
End Sub

Private Sub obMrs_Change()
If obMrs = True Then obFemale = True Else obFemale = False
End Sub

Private Sub obMs_Change()
If obMs = True Then obFemale = True Else obFemale = False
End Sub
 
Back
Top