Results 1 to 4 of 4
  1. #1
    Swarland is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Location
    Northumberland, UK
    Posts
    16

    Calculating from a Table

    I have a table (table2) that has fields to hold another tables ID (table1) and a currency total.



    From a form that relates to the table1 ID, I want to click a button that then totals all of the currency fields from table2 that have the same ID as in table1. The total then is to be inserted into a grand total field in table1.

    I have a query that does this, but don't know how to run this in vba and to extract the grand total figure from the query result.

    I have also tried to run a for, next routine, but get into difficulties in addrssing the table.

    Can anyone help please?

    regards

    Swarland

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How about using a DSum() function?

  3. #3
    Swarland is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Location
    Northumberland, UK
    Posts
    16
    Many thanks RuralGuy, it works a treat. Hope it isn't too cold at 8300'.

    Regards

    Roger

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by Swarland View Post
    Many thanks RuralGuy, it works a treat. Hope it isn't too cold at 8300'.

    Regards

    Roger
    Temp is just fine for me. Glad I was able to help.

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

Similar Threads

  1. Calculating Max appointments
    By ET123 in forum Access
    Replies: 2
    Last Post: 07-24-2010, 07:32 AM
  2. Calculating Dates
    By TC0126 in forum Queries
    Replies: 1
    Last Post: 02-23-2010, 08:13 PM
  3. Calculating the column value
    By access in forum Queries
    Replies: 6
    Last Post: 08-20-2009, 11:51 AM
  4. Calculating a sum on a report
    By missourijc in forum Reports
    Replies: 0
    Last Post: 10-30-2008, 07:21 PM
  5. Calculating Values
    By Jahan in forum Queries
    Replies: 1
    Last Post: 07-09-2006, 09:15 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