Results 1 to 6 of 6
  1. #1
    blueboi is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    3

    Checking for a sum totals row in a table

    Hello!

    I have a very specific question that I can't seem to find an answer to anywhere. I am trying to find where in the visual basic watch window I can check for
    what mode a totals row is in for a certain table. I know by going to Application.CurrentDB.TableDefs("TableName").Prope rties("TotalsRow").value, I can see if there is a totals row in the table "TableName", I just can't
    see if its calculating the sum for a certain column. I cannot do this via any other means i.e. a Dsum query or anything like that, I have to be able to see if there is a totals row in the table and what its value is, or what mode it is using.


    Any help is much appreciated!

    -Cheers!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    use a report or form,
    it will show you the total at the footer.
    =Sum(field)

  3. #3
    blueboi is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    3
    That works! Much appreciated! If you could help out a bit more, is there a way to generate a report from a table using VBA?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What do you mean by 'generate' - create a report from scratch with code? Code adds textboxes and sets properties? Why?

    Or do you mean VBA just opens a report object?
    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
    blueboi is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    3
    I mean VBA opens a report object populated with the contents of the table I was talking about earlier, similar to how in access you can produce a report from a table using the report button under the create tab.
    To give you an idea of the whole scope here, this is for a project that "tests" people learning how to use Access, so a user would take a db, make changes to it, and I use snippets of vba to evaluate their changes and ensure they did things properly.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Well, use DoCmd.OpenReport in some event, such as a button click.
    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.

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

Similar Threads

  1. Checking if data already exist in a Table
    By Phillsoft in forum Forms
    Replies: 2
    Last Post: 08-04-2011, 02:07 PM
  2. Checking if data already exist in a Table
    By Phillsoft in forum Forms
    Replies: 1
    Last Post: 08-04-2011, 08:03 AM
  3. Checking a table for changes
    By Rando in forum Queries
    Replies: 2
    Last Post: 10-07-2010, 09:25 AM
  4. Checking for data in table
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 07-27-2010, 01:32 PM
  5. Checking a record in a table
    By widstje in forum Programming
    Replies: 4
    Last Post: 11-07-2007, 11:28 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