Solved

Total value from combo box selection

Posted on 2011-03-12
3
486 Views
Last Modified: 2012-05-11
I am trying to modify my database to use a combo box for selecting various levels of sponsorship in a tournament.  Each level has a value that I need to total in a field.  I am certain that the solution is quite simple but I am missing something in my limited Access knowledge.
0
Comment
Question by:ukbusiness
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 35116014
You might need to requery your form or subform on the after update event of your Combo box.

Me.Requery or
Me.sfrmName.Requery

sfrName = the name of your subform

The code above will work if the record source of your form/subform is a query where the value of the combo box is used as filter criteria.

Sincerely,
Ed
0
 

Author Comment

by:ukbusiness
ID: 35117538
My problem goes deeper than just a requery.  I am using a combo box with multiple selections.  The combo box is working fine but the table it works off of contains the charge for each item.  I am trying to grab the total value of all items selected so that I can show them on a form and place them in a file for invoicing.
TypeID Type                                    Charge      
129      1 Player Sponsor                    $150.00      
104      2 Player Sponsor                    $300.00      
105      3 Player Sponsor                    $450.00
73      Beverage Cart - Sponsor            $750.00      
87      Breakfast and Lunch Sponsor   $600.00      
75      Bronze Sponsor                           $1,000.00      
0
 
LVL 19

Accepted Solution

by:
MINDSUPERB earned 250 total points
ID: 35119777
Create an unbound textbox in your form and put this in the control source property of the textbox.

=DSum("[Charge]","tblYourTableName","[TypeID]=" & Forms!frmName!cboName)

Ed
0

Featured Post

Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question