Results 1 to 12 of 12
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528

    Problems Textbox Default value 0

    A beautiful day
    I have a problem


    I have txtbox that set as a currency and I want to determine when the form load the txtbox is automatically have the value=0 but when I determine on DefaultValue property set as 0, it don't show me the value it only blank.

    Attached Thumbnails Attached Thumbnails a11.JPG  

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Where is this TextBox? On a Form or Report?
    What you have shown us is your Query.

    Is this TextBox field on your Form/Report a bound field?
    Is it bound to the TotalPayments field?

    If it is bound, it shouldn't show a blank, unless you are creating a new record on a Form (because other than that, it is always tied to a Query record, which should return the value you see in your Query).

  3. #3
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Thanks JoeM
    Yes it is on the form
    Yes also bound to the TotalPayments field

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    OK, so is it showing up on blank when viewing an existing record or when creating a new record?
    If when viewing an existing record, when you view that record in your query, what value does it show in the query for this "Total Payments" field?

  5. #5
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Yes JoeM showing up on blank when creating a new record .
    Attached Thumbnails Attached Thumbnails 4433.JPG  

  6. #6
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If it is a new record, where is the Remaining debt amount coming from?

  7. #7
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    JoeM Yes, and if there is not something that should be of zero value
    Where zero is to complete the calculation

  8. #8
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You didn't answer my question: where is the Remaining debt amount coming from?

  9. #9
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    I have tried to use the properties of the field but did not work.



    [Workorder Total]-Nz([Total Payments])
    Attached Thumbnails Attached Thumbnails rr4.JPG  

  10. #10
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You still have not answered the question I have asked twice now (I was specifically asking about the "Remaining debt" field).
    I am wondering if this is a new record, where exactly the amount of $2,376.00 is coming from.

    However, I see that your Total uses the NZ function. Try using that same sort of functionality in your Control Source, i.e.
    Code:
    =NZ([Total Payments],0)+0

  11. #11
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Coming from this process
    SELECT DISTINCTROW Workorders.WorkorderID, Workorders.CustomerID, Workorders.DateReceived, Workorders.SalesTaxRate, [Sum Of Payments Query].[Total Payments], [Parts Totals by Workorder].[Parts Total], [Labor Totals by Workorder].[Labor Total], [Workorder Parts].PartID, [Workorder Parts].Quantity, [Workorder Parts].UnitPrice, [Workorder Parts].DriverName, [Workorder Parts].DateLoad, [Workorder Parts].Nots, [Workorder Parts].DriverName, [Workorder Parts].TransferWages
    FROM (((Workorders LEFT JOIN [Sum Of Payments Query] ON Workorders.WorkorderID = [Sum Of Payments Query].WorkorderID) LEFT JOIN [Parts Totals by Workorder] ON Workorders.WorkorderID = [Parts Totals by Workorder].WorkorderID) LEFT JOIN [Labor Totals by Workorder] ON Workorders.WorkorderID = [Labor Totals by Workorder].WorkorderID) INNER JOIN [Workorder Parts] ON Workorders.WorkorderID = [Workorder Parts].WorkorderID;
    Attached Thumbnails Attached Thumbnails 3344455.JPG  

  12. #12
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I think we are talking apples and oranges here.

    If a record is truly a new record, there should not be any values associated with any fields. So I would expect that the Remaining debt, Total Payments, and Total fields to ALL be empty/null (if it is a new record, where exactly are these other field values coming from)?
    I suspect that you are either using some sort of LOOKUP function, or some sort of calculated running total on these other two fields, and I was hoping you would be able to tell what exactly what it is.

    However, did you try what I suggested in the previous post?
    Instead of trying to use the DEFAULT value, try replacing the Control Source for that field with that formula.
    Note that you may need to qualify the field with the Query name (whatever that is), i.e.
    Code:
    =NZ([QueryName].[Total Payments],0)+0
    If you are still running into trouble, it may be helpful if you can upload a copy of the database (removing and sensitive data first), and let us know which Form you are looking at.
    I cannot download it from my current location, but can from home later tonight.

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

Similar Threads

  1. VBA to return a textbox to default value
    By nick404 in forum Programming
    Replies: 6
    Last Post: 06-23-2015, 12:55 PM
  2. change default value of a textbox
    By bbxrider in forum Forms
    Replies: 4
    Last Post: 12-22-2014, 12:57 PM
  3. Default in Textbox
    By drunkenneo in forum Forms
    Replies: 7
    Last Post: 11-18-2013, 04:10 AM
  4. Textbox default value with datetimeyear
    By Perkowski in forum Access
    Replies: 8
    Last Post: 08-09-2012, 01:37 PM
  5. Bound textbox causes problems
    By LAazsx in forum Forms
    Replies: 8
    Last Post: 12-09-2010, 09:25 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