empty form field

Results 1 to 3 of 3

Thread: empty form field

  1. #1
    Join Date
    Dec 1969

    Default empty form field

    I&#039;m making a form that sends its data to an asp page that uploads the info to a Access database. Everything works fin if all the fields are filled in...but if the user misses a field I get an error saying that it must have a value. How can I make the value null or nothing so the database will accept it?<BR><BR>-Dizzy

  2. #2
    GoSixers Guest

    Default show code from both pages...


  3. #3
    Join Date
    Dec 1969

    Default No, allowing null fields in DB...

    You have to *tell* Access that you will allow a NULL value for a field. Or allow a zero-length string, which is *NOT* the same as a NULL, you know.<BR><BR>If you do <BR>&nsp; &nbsp; SQL = "INSERT INTO table (fld1,...) VALUES(&#039;" & Request("someFormField") & "&#039;, ... )"<BR>and the user has not filled in that form field, then you are inserting &#039;&#039; into fld1, and that is *NOT* the same as inserting a NULL. So you have to have "allow zero length" set in Access for that field.<BR><BR>In any case, all these things can be set in the Design View of a table in Access.<BR><BR>Oh...and if you *do* want to insert a NULL, then you must do<BR><BR>&nsp; &nbsp; SQL = "INSERT INTO table ( fld1, ... ) VALUES( NULL, ... )"<BR><BR>Note that you do *not* put &#039;...&#039; around the word NULL. It is a keyword.<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