set focus problem

David b

Registered User.
Local time
Today, 11:32
Joined
Mar 2, 2003
Messages
102
I have some error checking code in the after update event of a text box on a form.
If an error is found a msg box appears. When the msg box is closed I want the focus to be back to the
text box instead of moving through the tab order as usual.
I thought this should work but it doesn`t. Also tried docmd.gotocontrol.

Else
MsgBox "blah blah."
Me!TagNo.SetFocus

Any thoughts ?
TIA
David B
Hexham UK
 
You can't set the focus to the control that has the focus. You have to move it somewhere else first and then back to where you want it:

MsgBox "blah blah."
Me!AnotherControl.SetFocus
Me!TagNo.SetFocus

hth,
Jack
 
That what I needed
Thanks Jack
 

Users who are viewing this thread

Back
Top Bottom