I have an Access 200 database with a field set up as Date/Time and it is not required. When I go to insert something into the table, if there is not a date in that field, it gives me the error:
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
Here is the page code that inserts this info:
<%
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
Dim strNotes
strNotes = Replace(Request.Form("Notes"), "'", "''")
If Trim(Request.Form("MembershipDate")) = "" Then
strMembershipDate = "ommitted"
End If
If Trim(Request.Form("LastDateOfContact")) <> "" Then
strDateLastTalked = Replace(Request.Form("LastDateOfContact"), "'", "''")
strDateLastTalked = CDate(strDateLastTalked)
End If
If Trim(Request.Form("time_talents")) <> "" Then
strTalent = Replace(Request.Form("time_talent"), "'", "''")
End If
Set conn = server.createobject("adodb.connection")
DSNtemp="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("new_members.mdb")
conn.Open DSNtemp
If Trim(Request.Form("MembershipDate")) = "" Then
strMembershipDate = Null
Else
strMembershipDate = Replace(Request.Form("MembershipDate"), "'", "''")
End If
and that gives me the same error, so how do I do what you are saying?
Then perhaps you might try opening up the database and for the field in question be sure that the Required property toward the bottom is set to No instead of Yes.
Bookmarks