Results 1 to 8 of 8
  1. #1
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370

    Question Quick Question about a Query result

    Hello all,

    When my query returns the results, I would like for the "Totals" row to be opened automatically instead of having to click "Totals" in the ribbon.
    Is there a macro or SQL for after opening up the query that it automatically displays the "Totals" row?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    No code that I know of. Save the query after clicking Totals in the ribbon.

    Is this a dynamic parameterized query?

    Users should not work directly with tables and queries, just forms and reports.
    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.

  3. #3
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Saving the query does nothing after opening again the totals are gone

    Well it's a crosstab query.

    And I can't use a report for what I'm trying to display because the data in the crosstab query could change, therefor that would require creating a new report with the new data.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    Oh, saving a normal query with the Totals row works. Apparently, VBA to invoke the Totals row on a table or query involves editing QueryDefs. https://social.msdn.microsoft.com/Fo...orum=accessdev

    Building a report to run perpetually based on CROSSTAB is difficult, as you noted, but not impossible. Review http://allenbrowne.com/ser-67.html#ColHead

    Another alternative is VBA code and temp table.
    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.

  5. #5
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Thanks, I'll check out the references and get back to ya.

  6. #6
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Hmmm, after looking through both sources, I'm really not seeing what I'm trying to do. The first source's person has the same question as me, but he doesn't seem to get an answer for it either.

    Thanks for the help June7

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,965
    The first source does not indicate if it concerns a CROSSTAB and the only programmatic solution suggested was to modify QueryDefs. However, if it was not a CROSSTAB, user should have been able to save the query with the Totals row setting.

    Since I don't know your data, can't say if Allen's approach could be applied.

    That leaves VBA and temp table.
    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
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Yeah, VBA may be the only way to go. I'm checking out for the day, carry on the discussion tomorrow, hope you have a great rest of the day!

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

Similar Threads

  1. quick question -
    By alexandervj in forum Access
    Replies: 2
    Last Post: 03-17-2014, 10:58 AM
  2. Quick Question
    By chivo123 in forum Access
    Replies: 6
    Last Post: 01-24-2012, 09:52 AM
  3. Quick Question!
    By kp123 in forum Access
    Replies: 1
    Last Post: 12-12-2011, 02:21 PM
  4. Quick SQL Query question.
    By Suoipoc in forum Access
    Replies: 4
    Last Post: 09-06-2011, 09:10 PM
  5. Quick Question
    By Imgsolutions in forum Access
    Replies: 3
    Last Post: 07-19-2010, 11:22 AM

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