Results 1 to 5 of 5
  1. #1
    john134 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2014
    Posts
    42

    Enable Cross tab column totals with vba


    I have a crosstab query with years as the columns and names as the rows and donations as the values for each person for each year.

    I want to total the year columns. In view mode I can easily due that by clicking on Totals on the Home menu, going to the cell for this value and clicking on sum. But, how do I "click on Totals" from the Home menu automatically with vba code?

    John134

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    what is VBA to do?
    the query will pull the data and do the sums in columns. Row totals in the Total column.
    Are you wanting Column totals?

  3. #3
    john134 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2014
    Posts
    42
    Yes, I want to total the year columns.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The usual method is to create a second query that totals by year. Then a third query using UNION which will join both queries together. Get the sort order right and the totals will be displayed as the last row.

  5. #5
    john134 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2014
    Posts
    42
    I solved it by exporting to excel and then running a macro to get the column totals.

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

Similar Threads

  1. Cross column addition query
    By smytelka in forum Queries
    Replies: 3
    Last Post: 01-04-2013, 02:41 PM
  2. 2nd column in cross table query
    By khartoum in forum Queries
    Replies: 7
    Last Post: 07-04-2012, 12:40 PM
  3. Problem with cross tab on column heading
    By pascal_22 in forum Queries
    Replies: 0
    Last Post: 12-01-2010, 08:00 AM
  4. Cross Tab Column Headings...
    By mhoctober in forum Queries
    Replies: 3
    Last Post: 09-10-2010, 01:21 PM
  5. Query Column Totals
    By lmp101010 in forum Queries
    Replies: 1
    Last Post: 08-06-2010, 01: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