Results 1 to 5 of 5
  1. #1
    TrulyVisceral is offline Total N00B
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Deimos
    Posts
    102

    Post Have a text box or label display the total amount of something

    I just want a text or label to display the total amount of something in a table.

    Not the SUM of the values in a field, but rather, something like this.

    There's a field called "Value" and there's a bunch of cells with "A" in them and the rest are "B".



    I would like that in the form it displays how many "A" or "B" there are.

    My apologies if I don't explain myself well enough, struggling with english recently.

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Try this as the data source for the textbox
    "Value" is not a good choice for your data name. It is a reserved word in Access. Better something like Val_AB.

    =DCount("[Value]","MyTable","[Value]=" & "'" & A & "'" & ")"

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Maybe:

    Count(IIf([Value]="A",1,Null))

    or

    Sum(IIf([Value]="A",1,0))

    Value is reserved word, should not use reserved words as names for anything.
    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
    TrulyVisceral is offline Total N00B
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2018
    Location
    Deimos
    Posts
    102
    The field isn't called "Value" it's just an example.
    Thanks though, it helps.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Why use dummy names when real ones work just as well? And comments well be more relevant.

    Glad you got it working anyway.
    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. Creating a Text Box to Display a Running Total
    By Art_Of_War in forum Access
    Replies: 16
    Last Post: 01-03-2018, 10:49 PM
  2. Replies: 2
    Last Post: 05-25-2015, 05:02 AM
  3. Running Total on Amount for each Month?
    By aellistechsupport in forum Queries
    Replies: 4
    Last Post: 04-24-2014, 01:18 PM
  4. total amount
    By sdc1234 in forum Queries
    Replies: 12
    Last Post: 02-19-2014, 03:37 PM
  5. Replies: 3
    Last Post: 10-23-2009, 05:03 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