Results 1 to 7 of 7

Thread: Using a Long Integer Field in Access

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Posts
    34

    Using a Long Integer Field in Access

    Hello,
    I am trying to store track numbers in a Long Integer field. I'm getting the track number from a string and converting it to a long to write to the db. If the track string has no number, I want to leave it blank but Access is requiring me to put a number there or I get a Type Mismatch error. So I started throwing a '0' in for blank track numbers. Is there a way that I can leave it blank without having to put a zero in the db?
    Thanks,
    Rick

  2. #2
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Go into Access open the said table and go to the long integer field on the properties opf that field make "required" = no and Allow Zero Length = yes.

    good luck.
    b

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2002
    Posts
    34
    Hi Beacon,
    I'm using Access 2002, and I can't seem to find the 'Allow Zero Length' property. I have the 'required' set to 'no' already. Any ideas what I'm doing wrong?
    -Rick

  4. #4
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Sorry allow 0 length isnt avail for numbers.

    Remove the default value in the properties.
    It will be 0 as default.

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2002
    Posts
    34
    It's still forcing me to add a number to the field. I keep getting the type mismatch unless I throw a zero in there.

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 2002
    Posts
    34
    Beacon,
    Thanks for the help. I've decided to just take advantage of the NULL values.

  7. #7
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    hi rruble

    to answer your initial question:

    NO

    There is no way to leave a numeric field empty when saving it. This would break the convention of the numeric fields. A numeric field HAVE TO BE FILLED with data after a new record got created. Whatever the filling is .....

    Franky

Posting Permissions

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



Click Here to Expand Forum to Full Width