Results 1 to 4 of 4
  1. #1
    lyrasphere is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    3

    Red face Tallying a listbox's items

    I have a listbox that allows multiple entries. If you were to just query the field alone it would return the following:

    Apple
    Apple, Banana
    Apple, Banana, Orange

    I need a way to query this field to return something like this:

    Apple 3
    Banana 2
    Orange 1



    So that I can place the results in a subreport. Just about everything I have attempted has failed. I either get erroneous results or I get a single count for each entry that I cant tally via a query. Any help with this would be appreciated!

    - Russell

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Databases work best counting in a single column (top /down), not left to right. So you must store your results into a column...the above example would be
    Apple
    Apple,
    Banana
    Apple,
    Banana,
    Orange

    The query would then count the list.

  3. #3
    lyrasphere is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    3
    So how do I get the contents of the listbox which is in the format of:

    Apple
    Apple, Banana
    Apple, Banana, Orange

    Into a single column? Thanks!

  4. #4
    lyrasphere is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    3
    Scratch that - I see what I was doing. I was building a query off another. For some reason because I had that field in the previous query, it wouldn't allow me to list the contents in a single column that way. I think I have a work around now. Thank you!

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

Similar Threads

  1. Replies: 16
    Last Post: 03-31-2020, 10:19 AM
  2. Replies: 8
    Last Post: 11-11-2013, 08:39 PM
  3. prevent deselect items in the listbox after right click
    By masoud_sedighy in forum Programming
    Replies: 1
    Last Post: 08-13-2013, 01:06 AM
  4. Replies: 8
    Last Post: 05-24-2011, 03:41 PM
  5. Selected items in listbox
    By tomodachi in forum Access
    Replies: 1
    Last Post: 09-09-2010, 01:14 PM

Tags for this Thread

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