Setfocus

S

sigh

Hi,
I got two Text boxes. If I input wrong informations
into the BOX1 and press enter key to move to the next
field box2. I will got a message as error and I want it to
stay on the BOX1 instead of give me a message and move to
BOX2.
How can I do that? and on what poperty Event should I used?

Any help would be very appreciated.
 
G

Guest

I think that the 'BeforeUpdate' is the event that will
work best in this situation.
So write your code..

If BOX1.Value = "Test1" Then
Exit Sub
Else
MsgBox "Wrong data,try again"
Cancel = True
End If
 
T

Tim Ferguson

If I input wrong informations
into the BOX1 and press enter key to move to the next
field box2. I will got a message as error and I want it to
stay on the BOX1 instead of give me a message and move to
BOX2.

Look up help for ValidationRule. You can set a VR either on the field in
the table or in the control on the form (or both...)

HTH


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top