Userform change question

  • Thread starter Patrick C. Simonds
  • 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.
 
N

Norman Jones

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
'<<=============
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top