Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30
  1. #16
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521

    For starters, the other fields have to be included in the row source of the combo (they don't have to be visible). Don't forget to adjust the column count of the combo if you modify the existing combo. Second, your code wasn't associated with the combo. You want to click in the after update property of the combo, then on the ellipsis (...). Third, x is the column number, not the name:

    Me.TextTest = Me.ComboTest.Column(1)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    Join Date
    Apr 2010
    Posts
    21
    That worked fantastically! Thank-you SO much! I'm sorry I couldn't grasp it for so long

  3. #18
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem, glad we got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #19
    Join Date
    Apr 2010
    Posts
    21
    Now, I have actually 2 more questions, but I will try to get the most important one sorted out first. If you refer to my picture in the first post, you will see that I had a section for "Amount" in my purchase order. How would I be able to add up all of the values in the Amount column (I would have about 10 different text boxes, and access would add them up) and then how would I add them together, put the output in the subtotal box. Then apply math to find the taxes, then apply math for the final total? All I really need to know is how do I link the values in the text box together via math and have various outputs into other textboxes?

    I would have my format as Currency on the text box, all I really need to know is how to add values together from text box to text box and have the final product output into another textbox?

  5. #20
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You should be able to sum the amount field with a textbox in the footer:

    =Sum(AmountField)

    Other textboxes can refer to that one to use the total.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #21
    Join Date
    Apr 2010
    Posts
    21
    Sorry, I am very new to access.

    Would you be able to give a step by step sort of guide to add the values in my text boxes together and then putting the sum into another text box?

    I really would need step by step here as I do not understand most terminology

  7. #22
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Did you try what I suggested? Put a textbox in the footer. Give it the control source I mentioned, using your field name.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #23
    Join Date
    Apr 2010
    Posts
    21
    The textbox has to be in the main field of my form, it can't be in the footer >.<

  9. #24
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Have you made the normalization mistake of having multiple amount fields in the same record? If so:

    =Amount1 + Amount2 + Amount3
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #25
    Join Date
    Apr 2010
    Posts
    21
    Aha! That worked fantastically for all of the math in my form. Thank-you so much! On some of the purchase orders, PST would be optional, could I code a check box to allow PST to be added into the final total?

  11. #26
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sure, a "Taxable" checkbox would be an appropriate solution. You could then use an IIf() function (or an If/Then block in code):

    IIf(Taxable = True, Amount * PSTRate, 0)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #27
    Join Date
    Apr 2010
    Posts
    21
    EDIT: In the addition command that you gave me also, it now gives no output if there is no value in a textbox. How can I make it so it will still add them all up and ignore null values?

    I didn't quite understand that.

    Where would I put that statement? Under onClick then expression builder, or is it VBA code?

    I have a GST field that is used 100% of the time. My Final Total textbox adds up the Sub Total field (named "sub"), the GST field (named "gst") and the PST field (named "pst"). The final total field name is "total". I need this checkbox to simply remove all value from the PST field (if it is displaying $10.00 before the checkbox is checked, as soon as it is checked, it would just be left blank, then, as soon as the checkbox is unchecked, it would return to its original value). Would a checkbox be able to do that? If so, could you possibly set it up for me as I have listed the names of the text boxes that would possibly be used in this procedure?

    Thanks again, I would be still at square 1 without you

  13. #28
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    To have the checkbox do it, you'd use its after update event:

    Code:
    If (Me.CheckBox) Then
      Me.PSTField = YourCalculation
    Else
      Me.PSTField = 0
    End If
    To handle Nulls (empty fields), you can use the Nz() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #29
    Join Date
    Apr 2010
    Posts
    21
    That would work great, and I have it set up, except, the PST text field is set up as a control source and it cannot have a value added to it. Is there any way to make it editable whilst I have it as a control source?

    EDIT: Nevermind, got that working in the most roundabout way ever.

  15. #30
    Join Date
    Apr 2010
    Posts
    21
    How would I make my math on the sub total text box (sub total adding up 15 amount text boxes), ignore text boxes with nothing in them and just add up as if they had 0's in them. Pretty much, I need the sub total text box to think of null values as O's. Could you perhaps present me with a line of code for this?

    The amount textboxes use 2 other fields to get their value, so I couldn't have it auto display $0.00.

    EDIT: Got the Nz Function working, everything is great now. All I need is a button that can save the form as a PDF and I am done
    Last edited by SpeedyApocalypse; 04-10-2010 at 10:14 AM.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access 2003, sort order property of a form
    By Rick West in forum Forms
    Replies: 11
    Last Post: 09-17-2009, 08:28 PM
  2. Chart Order
    By protean_being in forum Reports
    Replies: 0
    Last Post: 06-19-2008, 09:26 AM
  3. Replies: 0
    Last Post: 12-11-2006, 04:55 PM
  4. inport data into invoice from Purchase order database
    By Wrangler in forum Import/Export Data
    Replies: 2
    Last Post: 10-30-2006, 12:28 PM
  5. CallTicketID populated to Order Form
    By EisBlade in forum Forms
    Replies: 0
    Last Post: 04-03-2006, 10:50 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