Results 1 to 3 of 3
  1. #1
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40

    Query sum from value list field


    I am trying to set up a query that calculates a sum from a text field that uses a value list. The values are "5mil", "10mil" and "20mil". I want the query to sum these numbers at quantities of 5, 10, and 20 respectively. How can I get the query to add the proper numbers based on the value selected?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    In the 'combo' box ,user picks 5,10 or 20.
    Then the function can use the choice in the combo to pull the results.
    'the Dsum() function sums the total miles after user updates the combo

    Code:
    cboMiles_Afterupdate()
    txtTotal = Dsum("[miles]", "table", "[CataMiles] = '" &  cboMiles & "'"
    
    end sub

  3. #3
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40
    Thank you!

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

Similar Threads

  1. Replies: 2
    Last Post: 04-05-2012, 08:39 PM
  2. Replies: 4
    Last Post: 07-27-2011, 09:52 AM
  3. Replies: 1
    Last Post: 02-03-2011, 11:19 AM
  4. Update Field list in Table with Query
    By Scorpio11 in forum Queries
    Replies: 3
    Last Post: 07-16-2010, 01:57 PM
  5. Replies: 6
    Last Post: 06-29-2010, 09:56 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