Solved

Total value from combo box selection

Posted on 2011-03-12
3
436 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
  • 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now