Results 1 to 3 of 3
  1. #1
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295

    How to make a bounded control default to 0


    Good Day All,

    I have a field "customer Deposit" in a table "Customers". The default value in the table is set to the number 0. However when this field is bounded to a control on a form the field on the form show up blank. In the property sheet of the form I also set the default value as 0 but this does not help. I also use the nz([customer Deposit], 0) and this does not work either.

    can anyone help me to get a zero value to display visibly in this form field?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    this is odd because setting the table defaultvalue =0 and/or form field.defaultvalue = 0 always works.
    you could also try,
    in the form event ON CURRENT
    add this code:

    Code:
    sub Form_onCurrent()
      if IsNull(txtBox) then txtBox= 0
    end sub

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    to be clear, the default will only work for new records - existing records with null values will not display 0 (although you can use the format property to display 0 instead of nothing) - property would be perhaps

    #;;;\0

    change the # to be whatever format you would normally display

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

Similar Threads

  1. Replies: 3
    Last Post: 05-15-2014, 03:38 PM
  2. Replies: 3
    Last Post: 08-15-2013, 03:26 PM
  3. (Un)bounded forms
    By Luciano in forum Forms
    Replies: 6
    Last Post: 03-10-2013, 03:27 PM
  4. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  5. Replies: 0
    Last Post: 04-12-2011, 10:37 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