Solved

Total value from combo box selection

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
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…

863 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

21 Experts available now in Live!

Get 1:1 Help Now