Solved

Total value from combo box selection

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

860 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