Userform question

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top