M
mharness
Hello,
Seems like I've been having trouble with this for a while and I don't know
why I feel the need for a solution today but here's the problem.
What do I need to do to put the focus back on a field where I have just
triggered an event. Something like this:
Dim strPrompt As String
If Me.SpotsCount < 1 Or Me.SpotsCount > 1000 Then
strPrompt = "Spots Count must be between 1 and 1,000."
MsgBox strPrompt, vbOKOnly, "Bad Number"
Me.SpotsCount.SetFocus
Me.SpotsCount = Null
End If
The problem is that the cursor always ends up in the next field in the tab
order and what I want is for it to be in the field where the error occured
so the user can correct it.
I know I can control this by removing the tab stops and setting the focus
programatically from one field to another but I'd rather not.
Thanks,
Mike
Seems like I've been having trouble with this for a while and I don't know
why I feel the need for a solution today but here's the problem.
What do I need to do to put the focus back on a field where I have just
triggered an event. Something like this:
Dim strPrompt As String
If Me.SpotsCount < 1 Or Me.SpotsCount > 1000 Then
strPrompt = "Spots Count must be between 1 and 1,000."
MsgBox strPrompt, vbOKOnly, "Bad Number"
Me.SpotsCount.SetFocus
Me.SpotsCount = Null
End If
The problem is that the cursor always ends up in the next field in the tab
order and what I want is for it to be in the field where the error occured
so the user can correct it.
I know I can control this by removing the tab stops and setting the focus
programatically from one field to another but I'd rather not.
Thanks,
Mike