J.Windebank
Registered User.
- Local time
- Today, 17:54
- Joined
- Apr 2, 2003
- Messages
- 37
Hi everyone,
I have a form that has two text boxes, in the first you enter a 4 digit number, and on exiting it (LostFocus) is automatically adds the 4 digit number, minus 1, into the second box, and moves focus to the third contrrol on the page.
The way I am doing this is by having:
txtBox1:
And for txtBox2:
Now this all works fine, except I have a command button to close the form, and if you try to close it without having any text in txtBox1, it produces the following error:
Anyone know a simple way around this please?
Thanks,
Jordan
I have a form that has two text boxes, in the first you enter a 4 digit number, and on exiting it (LostFocus) is automatically adds the 4 digit number, minus 1, into the second box, and moves focus to the third contrrol on the page.
The way I am doing this is by having:
txtBox1:
Code:
Private Sub txtBox1_LostFocus()
intPR = txtBox1.Text - 1
End Sub
And for txtBox2:
Code:
Private Sub txtBox2_Enter()
txtBox2.Text = intPR
txtBox3.SetFocus
End Sub
Now this all works fine, except I have a command button to close the form, and if you try to close it without having any text in txtBox1, it produces the following error:
Code:
Run Time Error '13':
Type Mismatch
Anyone know a simple way around this please?
Thanks,
Jordan