Inserting Null Date/Time values into Access

Results 1 to 2 of 2

Thread: Inserting Null Date/Time values into Access

  1. #1
    Grady Guest

    Default Inserting Null Date/Time values into Access

    When I try to insert a null value into an Access Date/Time field I get the error message "Type Mismatch." <BR><BR>For example:<BR>&#060;%<BR>rs.AddNew<BR>rs("Email") = strEmail<BR>rs("Date") = dteDate<BR>rs.Update<BR>%&#062;<BR><BR>I have the "Required Entry" in Access set to "No." Again, this only happens with Date/Time fields, text and other fields work fine. Thanks.<BR>

  2. #2
    Join Date
    Dec 1969

    Default Don't insert if null...

    ...didn&#039;t I answer this yesterday or earlier today? Or just a coincidence of postings?<BR><BR>AH, well..<BR><BR>&#060;%<BR>rs.AddNew<BR>rs("Email") = strEmail<BR>If isDate( dteDate) Then rs("Date") = CDate(dteDate)<BR>rs.Update<BR>%&#062;<BR><BR>See? Nothing at all is inserted if the user supplied value isn&#039;t a valid date.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts