If when a control recieves focus a certain condition is met, is it possible to set focus back to the control which previously had focus?
Printable View
If when a control recieves focus a certain condition is met, is it possible to set focus back to the control which previously had focus?
Use LostFocus to set a reference to the control you are moving away from and then just use that reference to set the focus back there...
i.e.
Cheers,Code:Dim ctl As Control
Sub SomeControl_LostFocus
Set ctl = Me.SomeControl
End Sub
Sub OtherControl_GotFocus
If Condition Then
ctl.SetFocus
End If
End Sub
P.
Quality, Cheers. :)