Focus Control

F

Frank Wagner

The SetFocus method does not work when I try to bring the
focus back to the same control after an error condition.
My code is the following:

Private Sub A1_AfterUpdate()

Dim Answer As Long

Answer = Me.X1 * Me.Y1 'Calculate Answer

If Me.A1 <> Answer Then 'If answer not correct
Me.A1.ForeColor = 255 'Change Color To Red
Me.A1.SetFocus ' ???? Doesn't work ?????
Else
Me.A2.SetFocus ' Does work
End If

End Sub

I'm stuck. Any help would be appreciated

Frank Wagner
 
Top