Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Validation Issue
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Validation Issue
Try:
If Me.TextBox1 = "" Or If Len(Me.TextBox1) = 0 Leo wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Validation Issue
Thanks JW. This works perfectly.
"JW" wrote: Try: If Me.TextBox1 = "" Or If Len(Me.TextBox1) = 0 Leo wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
userform date issue | Excel Worksheet Functions | |||
UserForm Issue | Excel Programming | |||
UserForm Save Issue | Excel Worksheet Functions | |||
Userform Issue | Excel Programming | |||
UserForm Listbox issue | Excel Discussion (Misc queries) |