Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform question
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform question
Sorry to have troubled anyone but I think I've sorted the problem.
"David Goodall" wrote in message news:y6Hpc.41$JL5.4@newsfe1-win... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Question regarding UserForm | Excel Discussion (Misc queries) | |||
UserForm Question | Excel Discussion (Misc queries) | |||
Userform Question | Excel Discussion (Misc queries) | |||
Userform Question | Excel Programming | |||
UserForm Question | Excel Programming |