moving from a check box to the next field.

  • Thread starter Thread starter Rani
  • Start date Start date
R

Rani

how do I move from a check box or an option group to the next field ?
I want the cursor to move automatically to the next field after the option
group or the check box was selected.
any idea ?
 
ok here is what I have in the after update event:

Me.BoxPurOpt.Visible = Me.CbPurOption
Me.LBLPurchaseAmount.Visible = Me.CbPurOption
Me.LBLPurchaseAmount.SetFocus

the only issue is that if the user will uncheck the box he will get a run
time error 2110

what's the correct way for doing so ?
 
ok here is what I have in the after update event:
Me.BoxPurOpt.Visible = Me.CbPurOption
Me.LBLPurchaseAmount.Visible = Me.CbPurOption
Me.LBLPurchaseAmount.SetFocus

the only issue is that if the user will uncheck the box he will get a run
time error 2110

what's the correct way for doing so ?

Only set the focus when the is visible:

'***
Me.BoxPurOpt.Visible = Me.CbPurOption
Me.LBLPurchaseAmount.Visible = Me.CbPurOption

'Only set focus to a visible or enabled control
If Me.LBLPurchaseAmount.Visible Then
Me.LBLPurchaseAmount.SetFocus
End If
'***
 
Only set the focus when the is visible:

Should read:

Only set the focus when the *control* is visible. <g>
 
Back
Top