I managed to create a UserForm in VBA for an Excel 2003 for inputing variable strings and one date. Now I would like to add validation to some of the fields so that it won't run if the fields are blank & if the date field is not in dd/mm/yyyy format.
I tried both Private Sub txt_cName_Change() and
Private Sub txt_cName_AfterUpdate()
Neither of these did anyting if the user skips the Company Name field.
Private Sub txt_cName_AfterUpdate()
If Me.txt_cName.Value = "" Then
MsgBox "You must type in a Company Name for this report", vbExclamation, "Company Name"
Me.txt_cName.SetFocus
End If
End Sub
Thank You for all your help.
I tried both Private Sub txt_cName_Change() and
Private Sub txt_cName_AfterUpdate()
Neither of these did anyting if the user skips the Company Name field.
Private Sub txt_cName_AfterUpdate()
If Me.txt_cName.Value = "" Then
MsgBox "You must type in a Company Name for this report", vbExclamation, "Company Name"
Me.txt_cName.SetFocus
End If
End Sub
Thank You for all your help.