|
travismp -> SQL Date field help - Data type mismatch in criteria expression. (6/16/2008 15:21:10)
|
I have an "Edit" Form. My user can click their record to bring up a form with all the pre-existing data, they change the text, hit submit then new data is saved. Works well. There are 50 fields total, if they will out EVERY single record and hit submit it works great, however there are about 10 date based fields in the backend DB, if they leave ANY of the dat fields empty then I get this error: Microsoft JET Database Engine error '80040e07' Data type mismatch in criteria expression. My code is almost 900 lines long so I am only going to post a sample of where I think the issue is.
<%if oktogo=1 and request.form("submit")="Update Record" then%>
<%'***** UPDATE RECORD IN DATABASE%>
<%
idtofind=replace(request.form("id"),"/","")
sql = "update tbl_Main set " _
& " Name='"&Name&"', " _
& " HomeAddress='"&HomeAddress&"', " _
& " RequestDate='"&RequestDate&"', " _
& " Sex='"&Sex&"', " _
Can I make any changes to this line to tell it is a date field so it goes on past this if it is left blank? & " RequestDate='"&RequestDate&"', " _ Thank you all.
|
|
|
|