|
-
Apr 29th, 2001, 06:17 AM
#1
Thread Starter
Lively Member
The best way is to use an If, then statement and pop up a messsage box if a text box is blank , then when they OK the message box you can set focus back to that text box. Here's a little code sample:
'put this code in the click event or the event you use to check the text box contents
Dim iMsg As Integer
'
If txt1.Text = "" Then
iMsg = MsgBox("Please enter some text in text 1", vbOKOnly, "Missing entry")
txt1.SetFocus
Exit Sub
'
ElseIf txt2.Text = "" Then
iMsg = MsgBox("Please enter some text in text 2", vbOKOnly, "Missing entry")
txt2.SetFocus
Exit Sub
'etc
'etc
End If
hope this helps
cheers
john
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|