brianfosterblack
Active Member
- Joined
- Nov 1, 2011
- Messages
- 251
I am using this code to take the date I have entered in a form and put it into a spreadsheet
The problem is that if I have not entered a valid date I get a mismatch error and lose everything I have entered in the form. How do I check when I enter the date into TextBox 3 that I have not entered a valid date so I do not get this error only once I try to enter the data from the form into the spreadsheet. I need to identify while still in the form that I have not entered a valid date and get taken back to TextBox 3 before proceeding further.
VBA Code:
ActiveCell.Value = CDate(FrmNewEntry.TextBox3)
Selection.NumberFormat = "dd/mm/yyyy"