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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setfocus event

Status
Not open for further replies.

Quique79

Programmer
Dec 18, 2001
15
MX
Hi!!

I'm designing a form, and in a textbox on lostfocus event I wrote this:

if Text27.text = "" then
Msbox "Data Needed"
Text27.setfocus
End if

Message works ok, but I got an error that I cannot establish a control property at least that the control has focus

What can I do?

Any tip or hint??? Quique79
 
Hi Quique79!

Try this in the BeforeUpdate event:

If Nz(Len(Text27.Text), 0) = 0 Then
YourMessageHere
Cancel = -1
End If

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top