Results 1 to 10 of 10
  1. #1
    Bobwords is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Minneapolis, MN
    Posts
    28

    Returning a specific count on a web form

    I'm pretty sure this one is simple, but I'm having a hard time figuring out how to return something on a count based off a condition. I work at a company that I am building a database to process our RMAs out of, and for the team that process the RMAs, I want to display a count of how many of each type of device is going to be shipped that day. Every RMA is only in one of two states: Processing or Shipped. On the first image below, I'm counting the number of RMAs that are currently pending. I need to count how many of each device type is currently pending. I'm looking for something like: If [status]=pending,count [device_type]

    Click image for larger version. 

Name:	Pending RMA device type 1.PNG 
Views:	13 
Size:	6.9 KB 
ID:	16946
    Click image for larger version. 

Name:	Pending RMA device type 1.9.PNG 
Views:	13 
Size:	23.2 KB 
ID:	16947



    I'm not sure if that is even a thing you can do with web forms (I'm going to move to a sharepoint front end early next year, so I'd like to keep everything web friendly)

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You might be able to do this with a formula but honestly I don't know if it would work on a webform. if this is just a single form you might be able to do it with domain functions like:

    =dcount("*", "[TableName]", "[Status] = 'Pending'")

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Won't SQL aggregate function work?

    =Count(IIf([Status]="pending",[device_type]))

    But that won't give a count for each device, it will count total devices pending. If you need a count for each device then need a calc for each device. How many devices? You show 5 in the image.

    Did you consider building a report using Sorting & Grouping features with aggregate calcs in footer?
    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
    Bobwords is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Minneapolis, MN
    Posts
    28
    Quote Originally Posted by June7 View Post
    Won't SQL aggregate function work?

    =Count(IIf([Status]="pending",[device_type]))

    But that won't give a count for each device, it will count total devices pending. If you need a count for each device then need a calc for each device. How many devices? You show 5 in the image.

    Did you consider building a report using Sorting & Grouping features with aggregate calcs in footer?

    It lists all the types I would need to count(5 in total). I understand I could do it with a report, but I'm trying to place the data in an immediately relevant place. This form is used daily, and I want to show how many of each device type needs to be pulled from inventory.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Did the suggested expression work?
    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.

  6. #6
    Bobwords is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Minneapolis, MN
    Posts
    28
    Quote Originally Posted by June7 View Post
    Did the suggested expression work?
    It kicks out an error saying it doesn't work for web compatible forms.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Sorry, I've never built a web db.

    If they won't do sql aggregates maybe Access domain aggregates will work.
    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.

  8. #8
    Bobwords is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Minneapolis, MN
    Posts
    28
    Quote Originally Posted by June7 View Post
    Won't SQL aggregate function work?

    =Count(IIf([Status]="pending",[device_type]))

    But that won't give a count for each device, it will count total devices pending. If you need a count for each device then need a calc for each device. How many devices? You show 5 in the image.

    Did you consider building a report using Sorting & Grouping features with aggregate calcs in footer?

    Ok, so I'm moving the database off of a web format to a normal access database (no access for sql on the sharepoint here). I only have the 5 device types, so how would I go about creating a calc for each of them to allow counting?

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

    =Count(IIf([Status]="pending" And [device_type]=6921, [device_type]))
    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.

  10. #10
    Bobwords is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Location
    Minneapolis, MN
    Posts
    28
    That was just what I needed!

    =Count(IIf([Status]="pending" And [device_type]="6921",1,Null))

    Can I buy you a beer or something?

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

Similar Threads

  1. Count is returning the wrong count.
    By khughes46 in forum Reports
    Replies: 2
    Last Post: 05-26-2014, 12:46 PM
  2. Specific Record Count
    By FormerJarHead in forum Queries
    Replies: 3
    Last Post: 08-23-2013, 11:02 AM
  3. Count of specific number
    By samirmehta19 in forum Access
    Replies: 3
    Last Post: 05-20-2013, 02:29 PM
  4. Replies: 6
    Last Post: 04-26-2012, 10:00 PM
  5. Count of field based on specific values
    By tazzmann67 in forum Access
    Replies: 2
    Last Post: 03-30-2011, 09:11 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