Results 1 to 6 of 6
  1. #1
    adamjon92 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Feb 2016
    Posts
    6

    Adding Totals to Combo Box


    Hello,

    I currently have a combo box where when you choose a company name, all of the totals come up for that company in a subform, including spend, tonnage, and spend per ton on each lane that ABC ships on. Whenever I click ABC, for example, all of the data comes up for only ABC and the lanes it ships on (let's call them Lanes 123, 456, and 789). I have roughly 50 different companies on the list, and I was wondering if there was any way to have an option for totals in the company name drop box, so when I click totals, all of the different lanes and companies come up in the subform. So for lane 123, companies ABC, DEF, and GHI would come up so I could compare the spend, tonnage, and spend/ton with each of them.

    Thanks,

    Adam

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    yes, instead of the query you use to fill the box of companys, use a sum query on each company so you get 2 columns: CO , SUM
    Set the combo to show 2 columns. (also set the Col.widths too, else it will be random)

  3. #3
    adamjon92 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Feb 2016
    Posts
    6
    Sorry, I wasn't clear enough in my question. Basically, whenever I select a company from the combo box, it shows all of the data for that company in the subform. The combo box works as a filter for the company name column in the subform. In the table that the subform is the being pulled from, there are 50,000 rows, so there's roughly 1,000 rows of lanes for each company (because I have 50 companies in my combo box). So whenever I select a company, there are 1,000 rows that show up for that company. Instead of only selecting one company at a time (and basically filtering the results for one company), I want to include all 50,000 rows in the subform. So in simple terms, I want to remove all filters and have every single row, regardless of the company, in the subform. Does that clarify at all? Thanks.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Where is the combo box? In the main form header? Sub form header?


    Is there code in an event of the combo box?


    What happens if you open the subform in stand alone mode? Do you get the results you want?

  5. #5
    adamjon92 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Feb 2016
    Posts
    6
    Quote Originally Posted by ssanfu View Post
    Where is the combo box? In the main form header? Sub form header?


    Is there code in an event of the combo box?


    What happens if you open the subform in stand alone mode? Do you get the results you want?
    Thanks for the reply. The combo box is currently in the main form detail section. There is no code for the combo box. The row source is just the table that the information is being pulled from. In terms of the stand alone mode, that is exactly what I am looking for. It is all of the data that I need, and it isn't broken up by the company name. I want to be able to include that all in the sub form, but when I select a company name from the combo box, it filters the company name column in the sub form, and only shows those results. Hopefully I'm making sense. Thanks!

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I am having a hard time visualizing how your dB is set up. Any chance of posting your dB? Just need 3 or 4 records for a couple of companies. Change any sensitive info.
    Do a Compact and Repair then zip it.

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

Similar Threads

  1. Query for adding totals from several tables
    By rosscortb in forum Queries
    Replies: 7
    Last Post: 01-05-2015, 01:27 PM
  2. adding up totals in query
    By nightangel73 in forum Queries
    Replies: 3
    Last Post: 06-18-2014, 01:02 AM
  3. Replies: 1
    Last Post: 08-06-2013, 07:52 PM
  4. Adding totals to a form from a subform
    By Niki in forum Access
    Replies: 13
    Last Post: 05-13-2011, 12:17 AM
  5. Adding Totals to a query using queryDef
    By jrickels in forum Programming
    Replies: 7
    Last Post: 04-06-2010, 07:47 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