type mismathc error issue

Results 1 to 3 of 3

Thread: type mismathc error issue

  1. #1
    Join Date
    Dec 1969

    Default type mismathc error issue

    I have 3 fields on a form that may or may not be filled out by the user. All 3 are set to integer in the Access database.<BR><BR>Using Addnew when I try to do the insert into the database if the 1st 1 is blank or filled in no problem. If either or both of the other 2 is blank I get type mismatch error. This is confusing because the first field can be left blank and if you fill in the other 2 it flies right through. Any thoughts would be appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: type mismathc error issue

    Can you post your insert statement?<BR><BR>Thanks!

  3. #3
    Join Date
    Dec 1969

    Default There isn't any INSERT statement...

    She said she was using ADDNEW.<BR><BR>The "trick" is, when a value is not given for a field and you are using AddNew, simply DO NOT assign *anything* to the field in your ASP code.<BR><BR>SO something like this:<BR><BR>&#060;%<BR>...<BR>RS.AddNew<BR>If Request("xyz") &#060;&#062; "" Then RS("xyz") = Request("xyz")<BR>If Request("abc") &#060;&#062; "" Then RS("abc") = Request("abc")<BR>...<BR>RS.Update<BR>...<BR>%&#06 2;<BR><BR>Note that the fields thus omitted *must* have been marked as "can be null" in the table design.<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