|
-
January 20th, 2000, 12:48 AM
#1
Visual Basic Form Validations
Hi,
How do i set the focus back onto a textbox
eg : I am using the following code in my Visual Basic project
If IsNumeric(txtJobCode.Text) Then
If txtJobCode.Text < 100 Or txtJobCode.Text > 174 Then
MsgBox "Please enter a number for JOBCODE between 100 and 174 only."
txtJobCode.SetFocus
End If
End If
I do get the message box but i never get the setfocus back onto the textbox
Please Help,
New to Visual basic.
PS : This is not VBScript in html but i am working on a visual basic project. 
-
January 20th, 2000, 01:38 AM
#2
Re: Visual Basic Form Validations
i think ur code is perfect the problem may be u may have more codes after this set in the same procedure so u have to say exit sub after setting the focus so the procedure stops there. iam sending u the corrected code okay. also tell me where r u writing this code in which event(is it lostfocus of the text box)
If IsNumeric(txtJobCode.Text) Then
If txtJobCode.Text < 100 Or txtJobCode.Text > 174 Then
MsgBox "Please enter a number for JOBCODE between 100 and 174 only."
txtJobCode.SetFocus
exit sub
End If
End If
-
January 20th, 2000, 12:58 PM
#3
Re: Visual Basic Form Validations
I no i have the same problem, this might help make it focused:
txtJobCode.text = ""
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
|