Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Required fields in Excel [email protected] New Users to Excel 5 November 4th 10 05:33 PM
how to have fields to be required Mandatory fields in Excel Excel Worksheet Functions 1 June 6th 08 10:41 PM
Required fields with comments Cathy Landry Excel Worksheet Functions 0 August 19th 05 06:18 PM
highlighting required fields maryann Excel Worksheet Functions 2 June 23rd 05 06:16 PM
Required fields Emily Excel Discussion (Misc queries) 1 June 23rd 05 12:59 AM


All times are GMT +1. The time now is 01:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"