I have a bit of code which on form load look up a textbox value, compares it to the current date and if more than 25 days ago produces an input box.
This input box has todays date as the default value and when the user clicks ok sets the text box as this date.
----------------------------
If (Date - txtswiddate) >= 25 Then
Dim msg2, Title2
msg2 = "BLAH BLAH."
Title2 = "TITLE BLAH"
Default2 = (Date)
response2 = InputBox(msg2, Title2, Default2)
txtbox.Value = response2
End If
-----------------
The textbox format is general date.
If I type the date into the text box as 25/12/2011 and then reload the form the code runs correctly and changes the text box to 19/01/2012.
If the form is reloaded again I get a type mismatch 13 error!?
I'm not an access guru by any means and presume it has something to do with the textbox not being the correct format?? but can't figure out how to fix it.
Any help is gratefully appreciated!