Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2008
    Location
    Sugar Land, Tx
    Posts
    2

    total in textbox

    Trying to show the total of these textbox controls.



    I tried this:

    =[FinRes]+[Gap]+[Vsc1]+[Vsc2]+[OtherF&I]

    in the control source of the textbox control but that only works if there are numbers in all the fields.

    So I try this:

    =IIf(IsNull([FinRes]+[Gap]+[Vsc1]+[Vsc2]+[OtherF&I]),0,([FinRes]+[Gap]+[Vsc1]+[Vsc2]+[OtherF&I]))

    But same thing.
    How do I get the total to work if some of the fields are empty?

    Sorry, just learning Access, thanks for any help.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Use the Nz() function.
    =Nz([FinRes],0)+Nz([Gap],0)+Nz([Vsc1],0)+Nz([Vsc2],0)+Nz([OtherF&I],0)

  3. #3
    Join Date
    Nov 2008
    Location
    Sugar Land, Tx
    Posts
    2
    Thanks for answering; I was beginning to wonder if anyone was on here helping. I finally figured it out and that's exactly what I did. I can't believe something so simple is so hard in Access (compared to Excel - which is what I am used to). Thanks again.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! You always learn more when you solve it yourself anyway.

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

Similar Threads

  1. Keeping text in a report textbox
    By Hawkx1 in forum Reports
    Replies: 2
    Last Post: 11-13-2008, 04:11 PM
  2. Replies: 1
    Last Post: 08-10-2008, 01:09 AM
  3. Textbox will not allow input
    By cwf in forum Forms
    Replies: 0
    Last Post: 04-04-2008, 04:08 PM
  4. dynamic textbox
    By vam in forum Programming
    Replies: 1
    Last Post: 06-04-2006, 08:59 AM
  5. Report will not print a bound textbox
    By vvrt in forum Reports
    Replies: 0
    Last Post: 03-16-2006, 02:16 PM

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