KeyDown event on form

  • Thread starter Horatio J. Bilge, Jr.
  • Start date
H

Horatio J. Bilge, Jr.

I have a UserForm with 2 sets of Option buttons. In the frame frmHome, I have
optHome1 and optHome2. And in frmAway I have optAway1 and optAway2.

What I want to do is set it up so when a user selects optHome1, the form
automatically selects optAway2. Likewise, optHome2 would automatically select
optAway1, and vice versa.

I tried using the KeyDown event on the form, but it doesn't seem to do
anything.
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
If Me.optHome1.Value = True Then
Me.optAway2.Value = True
ElseIf Me.optHome2.Value = True Then
Me.optAway1.Value = True
End If
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