Userform Validation Issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to build validations into a userform to make sure that all
requested data is entered. However, the validation is not working, allowing
null values to be saved, which is not good given that the form feeds a
database through ADO code.

I think the problem is that I typically program VBA in Access, and likely
have an Excel VBA syntax issue. Below is an example of the code I am using to
validate. Any suggestions?

Thanks,
Leo

Private Sub btnSubmit_Click()
On Error GoTo catch

'Validate form inputs
If IsNull(Me.txtName.Value) Then
MsgBox "Please enter customer's name!", , "INFO REQUIRED"
Exit Sub
End If
Exit Sub
 

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

Back
Top