Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 509
  • Last Modified:

Total value from combo box selection

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
ukbusiness
Asked:
ukbusiness
  • 2
1 Solution
 
MINDSUPERBCommented:
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
 
ukbusinessAuthor Commented:
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
 
MINDSUPERBCommented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now