Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to stop user exiting a text box if null

Status
Not open for further replies.

netsmurph

Technical User
Mar 19, 2003
63
GB
Is there any sensible way to stop a user from leaving a text box null, have tried it on exit, but will not set the focus back there.

One work around is to set the on enter procedure to make the check on every other control on the form, but this seems far too long winded!

Anyone got any gems?

Many thanks

Andrew
 
Have tried it but it wont work, i can get it to work by setting the focus to another control and then back, ie:

If IsNull(Me.Text1) Then

Me.Text3.SetFocus
Me.Text1.SetFocus

End If

Can you see any better way to do it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top