|
-
Oct 17th, 2006, 09:01 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Runtime error 5
Hello All,
I am using VB 6.0 with Win 2000 OS. My problem is that I am getting "Runtime Error 5" when I runs project exe on other machine(Win 2000)but it runs smooth on my machine(Win 2000).
On following Bold line, I am getting an error:
VB Code:
If txtHostID.Text <> vbNullString Then
If Val(txtHostID.Text) >= 61569 And Val(txtHostID.Text) <= 63487 Then
MsgBox "Invalid Host Game ID Number." & vbCrLf & "Range 0xF081-0xF7FF Reserved for Non Configured Games.", vbOKOnly + vbCritical, "Host Game ID Number"
txtHostID.Text = vbNullString
[B]txtHostID.SetFocus[/B]
Exit Sub
End If
End If
Above code is in txtHostID_LostFocus() event.
Last edited by shirishdawane; Oct 17th, 2006 at 09:07 AM.
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Oct 17th, 2006, 09:25 AM
#2
Re: Runtime error 5
Try useing the Validate event instead.
VB Code:
Private Sub txtHostID_Validate(Cancel As Boolean)
If txtHostID.Text <> vbNullString Then
If Val(txtHostID.Text) >= 61569 And Val(txtHostID.Text) <= 63487 Then
MsgBox "Invalid Host Game ID Number." & vbCrLf & "Range 0xF081-0xF7FF Reserved for Non Configured Games.", vbOKOnly + vbCritical, "Host Game ID Number"
txtHostID.Text = vbNullString
Cancel = True
Exit Sub
End If
End If
End Sub
-
Oct 17th, 2006, 09:53 AM
#3
Thread Starter
Hyperactive Member
Re: Runtime error 5
Thanx Andrew.....its working
But I would like to know reason why it is happening?
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Oct 17th, 2006, 10:09 AM
#4
Re: Runtime error 5
I'm not sure why it didn't work. I've tried to reproduce the problem but it didn't seem to come up with the error. It might be a bug or something.
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
|