G
Guest
Acc03/WinXp
I am using an input box for a user to enter in a date. The variable is
defined as a date field, but I'm guessing that InputBox automatically reads
as string. I would like to verify that the information entered by the user
is a valid date.
I understand that if I do the following....
InvDate = CDate(InputBox("Please enter a date. Use mm/dd/yy format."))
....and the user inputs an invalid date, an Error 13: Type Mismatch occurs.
Is there a way to trap for that error and return to the input box to have
the user try again? Or do I create a function to check the entry and run a
simple loop on the input box until a valid date is entered (or the user hits
cancel)?
Thanks!
I am using an input box for a user to enter in a date. The variable is
defined as a date field, but I'm guessing that InputBox automatically reads
as string. I would like to verify that the information entered by the user
is a valid date.
I understand that if I do the following....
InvDate = CDate(InputBox("Please enter a date. Use mm/dd/yy format."))
....and the user inputs an invalid date, an Error 13: Type Mismatch occurs.
Is there a way to trap for that error and return to the input box to have
the user try again? Or do I create a function to check the entry and run a
simple loop on the input box until a valid date is entered (or the user hits
cancel)?
Thanks!