D
David Goodall
Hello
I've used the following code to validate an entry into a textbox.
Private Sub TextBox1_Change()
Dim number_of_locations As Integer
If TextBox1 = vbNullString Then Exit Sub
If Not IsNumeric(TextBox1) Then
MsgBox "Sorry, numbers only"
TextBox1 = vbNullString
Else
number_of_locations = val(TextBox1.Value)
addlocations (number_of_locations) ' this prompts a second userform to
appear based on the no of locations
Exit Sub
End If
End Sub
The addlocations sub then unloads the first form and the user enter details
in the second userform. After the information is entered I use a cmd button
to reload the first userform. The problem is that the textbox on form 1 does
not react to any changes. I need a way to reset the textbox.
Any help as always greatly appreciated.
David
I've used the following code to validate an entry into a textbox.
Private Sub TextBox1_Change()
Dim number_of_locations As Integer
If TextBox1 = vbNullString Then Exit Sub
If Not IsNumeric(TextBox1) Then
MsgBox "Sorry, numbers only"
TextBox1 = vbNullString
Else
number_of_locations = val(TextBox1.Value)
addlocations (number_of_locations) ' this prompts a second userform to
appear based on the no of locations
Exit Sub
End If
End Sub
The addlocations sub then unloads the first form and the user enter details
in the second userform. After the information is entered I use a cmd button
to reload the first userform. The problem is that the textbox on form 1 does
not react to any changes. I need a way to reset the textbox.
Any help as always greatly appreciated.
David