R
ruoxuan.zhu
Hi,
I have a form that have a set of Option Buttons (rdbOutRange, rdbNWB, and rdbNWS) and a RefEdit (redOutputRange).
When I select the Option Button (rdbOutRange), I want it put the cursor in the RefEdit (redOutputRange).
My current code does this. But if I select something else, and then reselect Option A, it doesn't work anymore.
It looks like that the code is stuck at the next line if I put a Breakpoint on the SetFocus line.
My code is the following:
Private Sub rdbOutRange_Change()
Application.EnableEvents = False
If Me.rdbOutRange.Value = True Then
Me.redOutputRange.Enabled = True
Me.redOutputRange.SetFocus
Else
Me.redOutputRange.Value = ""
Me.redOutputRange.Enabled = False
End If
Application.EnableEvents = True
End Sub
What I am doing wrong?
Thanks,
Mike
I have a form that have a set of Option Buttons (rdbOutRange, rdbNWB, and rdbNWS) and a RefEdit (redOutputRange).
When I select the Option Button (rdbOutRange), I want it put the cursor in the RefEdit (redOutputRange).
My current code does this. But if I select something else, and then reselect Option A, it doesn't work anymore.
It looks like that the code is stuck at the next line if I put a Breakpoint on the SetFocus line.
My code is the following:
Private Sub rdbOutRange_Change()
Application.EnableEvents = False
If Me.rdbOutRange.Value = True Then
Me.redOutputRange.Enabled = True
Me.redOutputRange.SetFocus
Else
Me.redOutputRange.Value = ""
Me.redOutputRange.Enabled = False
End If
Application.EnableEvents = True
End Sub
What I am doing wrong?
Thanks,
Mike