I'm trying to enter a date thru an input box with error checking. The code is included at the end. If the date is wrong I want to re-display the input box. My problem is that the input box is re-displayed on the first error but if I re-enter a bad value again (ex. 13/41/04) I get the ugly Access "Type Mis-match Error" box which asks me to end or debug. How do you get the input box to re-appear till they get it right?
The code...
Sub ReportDate()
On Error GoTo ErrorTrap
ReportDate = Nz(InputBox("Enter a Date: mm/dd/yy"), Date)
reportYear = Year(ReportDate)
reportMonth = MonthName(Month(ReportDate), True)
Exit Sub
ErrorTrap:
Resume
End Sub
Thanks for any help, George