Prevost
Board Regular
- Joined
- Jan 23, 2014
- Messages
- 198
Hi,
I have a userform with 2 textboxes that a user can enter values in. When I step through the code, WOQty is "0" and WONo is "" even when the textboxes have values entered into them. I declared 'Public WOQty as Integer' and 'Public WONo as String' in my UserForm and then tried in a Module and I still get the same error. Any ideas?
Thanks!
I have a userform with 2 textboxes that a user can enter values in. When I step through the code, WOQty is "0" and WONo is "" even when the textboxes have values entered into them. I declared 'Public WOQty as Integer' and 'Public WONo as String' in my UserForm and then tried in a Module and I still get the same error. Any ideas?
Thanks!
Code:
Private Sub OK_Click()
WOQty = Me.TextBox1.Text
WONo = Me.TextBox2.Text
If IsEmpty(WONo) = True Then
MsgBox ("Please Enter A Work Order Number")
boolrestart = True
ElseIf IsNumeric(WOQty) = False Then
MsgBox ("Please Enter A Numeric Quantity")
boolrestart = True
ElseIf IsEmpty(WOQty) = True Then
MsgBox ("Please Enter A Work Order Quantity")
Else
Worksheets("Template").Unprotect Password:=""
WOEntry.Hide
i = 1
SheetName = WONo & "-" & i
Sheets("Template").Copy After:=Sheets(1)
ActiveSheet.Name = SheetName
Call Create_Button
Worksheets("Template").Protect Password:=""
Worksheets(SheetName).Unprotect Password:=""
End If
End Sub