Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2012
    Posts
    23

    How to get a "" value in stead of "0"

    Dear all,

    I have created a form in which I have to enter some details (including a number). Thing is that access now automatically fills in a "0" if I do not filll in anything. I do not want this however cause the value needs to be blank (=""). See attachment

    Click image for larger version. 

Name:	naamloos.JPG 
Views:	23 
Size:	124.6 KB 
ID:	13996

    Anybody a clue on how I can fix this?

    Thanks!

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    In the properties for the table, have you set up a default value of zero for the particular field?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Yes, sounds like 0 is set as default in table.

    Remove this and the field will be Null if no value entered, not "" which is an empty string. Null and empty string are not the same things. A number field cannot have a string, empty or not.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Join Date
    Oct 2012
    Posts
    23
    It does not work. If I fill in nothing at default value, still a "0" pops up in my form....


    Quote Originally Posted by June7 View Post
    Yes, sounds like 0 is set as default in table.

    Remove this and the field will be Null if no value entered, not "" which is an empty string. Null and empty string are not the same things. A number field cannot have a string, empty or not.

  5. #5
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    You may want to upload a sample of your database sanitized for confidential material (put in dummy data). Then it can be analyzed otherwise, it is as if we are tossing darts blindfolded.

    In the quick reply window, click on go advanced. Run a compact and repair before uploading.

  6. #6
    ipisors is offline Access Developer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    119
    This is probably because the field is currency. Why would you want the default to be a zero length string (if it's even possible) if the field type needs to be currency? Rarely do people trade goods or services for "" It's either 0 or it's a number.

    That's the default Access behavior ... and with good reason.

    I think you may need to re-think the field type, and the why behind your wanting a ZLS instead of a zero.

    But there may be other issues too. Are you creating a user interface where the user interacts directly with a table? If so you shouldn't be ... Access is not a spreadsheet.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Are you saying the field does not have DefaultValue and new records still show 0? Then something else is going on. If it were defined as Currency there would be currency symbol.

    Existing records have already been populated and removing the DefaultValue property does not impact those existing records. You will have to edit them. Can run an UPDATE query to change 0 to Null.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-14-2012, 04:47 PM
  2. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  3. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  4. Replies: 16
    Last Post: 07-22-2011, 09:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums