Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Validating Required Fields in Userform
Hello
I have created a userform with around 10 fields. 6 of these fields are required fields. There is a command button on the userform called "Add to List". When this command button is clicked, all the data on the userform is transferred to an spreadsheet in the background. The required fields are listed below in the order as they appear on the userform • Date • Docket Number • Customer • Amount • Driver • Truck Rego Number When I place the cursor on the date field and tab through all the fields, filling in the appropriate data, I then click on the button "Add to List". Everything is transferred to the spreadhsheet. The issue arise as follows: I place the cursor with the mouse on the Customer field and fill in the customer and tab through the remaining fields filling in the appropriate data. I then click on the "Add to List" button and it transfers the data to the spreadsheet. The userform is cleared out allowing me to enter the next record. However the fields for Date and Docket Number are blank. I would like to put in some validation code when the "Add to List" button is clicked, that would come up with a message saying that in this example "Date is blank, please enter a valid date" I have tried various options but no success. I would also like to avoid getting a "Run Time Error 13" message. I want to end user to only see the user form. Any help would be appreciated. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Required fields in Excel | New Users to Excel | |||
how to have fields to be required | Excel Worksheet Functions | |||
Required fields with comments | Excel Worksheet Functions | |||
highlighting required fields | Excel Worksheet Functions | |||
Required fields | Excel Discussion (Misc queries) |