sum combo box based on other combo box


A

Alan

Hi can anyone help

i have two combo box which are Customer Number and Period Posting Date
coming from the same table,
what i'm after is after combo box which will give me all value for each
Customer in a specific posting Date month

for example

if some select Customer Number 0001 in combo box 1
and then select 2009/07 in Combo box 2
i want combo 3 or a text box to sum the values in thee amount column and
display the total in combo 3 or they text box

thanks in advance
 
Ad

Advertisements

A

Arvin Meyer [MVP]

If you don't have to store the total (and you shouldn't store calculated
results), a simple expression in the controlsource property of the text box:

= Combo1.Column(2) + Combo2.Column(4)

Column 2 is the 3rd column. and Column 4 is the 5th column.

If you don't need to store it, use the AfterUpdate event of each combo to
check for a valid value in the other combo, then write the calculation to
the textbox.
 
Ad

Advertisements

A

Alan

Arvin Meyer said:
If you don't have to store the total (and you shouldn't store calculated
results), a simple expression in the controlsource property of the text box:

= Combo1.Column(2) + Combo2.Column(4)

Column 2 is the 3rd column. and Column 4 is the 5th column.

If you don't need to store it, use the AfterUpdate event of each combo to
check for a valid value in the other combo, then write the calculation to
the textbox.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access





.
Hi

thanks for replying

but This is still not working, maybe i've done something wrong

But
combo box 1 is a customer number 0001 feild(0)
combo box 2 is a posting date 2009/07(1)

Then i have an amount field with all sales that went through

what i need is the textbox to look up on the combo box 1(Customer Number)
which and then look up on combo box 2(Posting Date), then once is lookup on
those variables in the combo boxs, SUM all values for that customer and on
that month and display it

eg

combo box 1 - customer number 0001
Combo Box 2 - Posting period date 2009/07
Text Box - Amount £5000


Thanks again, sorry if it seems confusing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top