R
Randi W
Another newbie question:
I have two input fields for dates in my form, I have created them as Text
Boxes with format 'General Date'. The values should be put into date/time
columns in a table in a 'On Click' event. This works fine when there are
some values in the FromDate and ToDate fields:
DoCmd.RunSQL ("Insert into TableA (code1, code2, fromdate, todate) values
('" & Element1 & "','" & Element2 & "', CDATE('" & fromDate & "'), CDATE('"
& toDate & "') ) ")
But - if fromDate or toDate are empty I get this error message:
"Run-time error 3464
Data type mismatch in criteria expression."
I have tried some different ways that include IIf an IsNull, but cannot make
this work..
Thanks for your help!
Randi W
I have two input fields for dates in my form, I have created them as Text
Boxes with format 'General Date'. The values should be put into date/time
columns in a table in a 'On Click' event. This works fine when there are
some values in the FromDate and ToDate fields:
DoCmd.RunSQL ("Insert into TableA (code1, code2, fromdate, todate) values
('" & Element1 & "','" & Element2 & "', CDATE('" & fromDate & "'), CDATE('"
& toDate & "') ) ")
But - if fromDate or toDate are empty I get this error message:
"Run-time error 3464
Data type mismatch in criteria expression."
I have tried some different ways that include IIf an IsNull, but cannot make
this work..
Thanks for your help!
Randi W