freddie mitchell
New Member
- Joined
- Apr 14, 2011
- Messages
- 43
Hello everyone,
I'd like to put a mandatory field in a functioning VBA userform. This is primarily to stop a runtime error 13 appearing if no value is entered. However, the mandatory field code I've added also brings up an error 13, instead of a message asking the user to input a value. Does anyone know how to get the mandatory field to code to run without the error 13 appearing? I've posted the code for the mandatory field below.
If anyone can help with this that would be amazing!
Thank you and happy holidays,
I'd like to put a mandatory field in a functioning VBA userform. This is primarily to stop a runtime error 13 appearing if no value is entered. However, the mandatory field code I've added also brings up an error 13, instead of a message asking the user to input a value. Does anyone know how to get the mandatory field to code to run without the error 13 appearing? I've posted the code for the mandatory field below.
VBA Code:
Private Sub OKButton_Click()
'check start date is filled correctly
If StartDate.Value = "" Or "DD/MM/YY" Then
MsgBox "please fill in the start date", vbCritical
Cancel = True
Else
'starting insert row function
Call Insert_Row
End If
End Sub
If anyone can help with this that would be amazing!
Thank you and happy holidays,