A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

sum combo box based on other combo box



 
 
Thread Tools Display Modes
  #1  
Old March 22nd, 2010, 10:59 PM posted to microsoft.public.access.forms
Alan
external usenet poster
 
Posts: 459
Default sum combo box based on other combo box

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
  #2  
Old March 23rd, 2010, 03:21 AM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default sum combo box based on other combo box

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


"Alan" wrote in message
...
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



  #3  
Old March 23rd, 2010, 10:00 AM posted to microsoft.public.access.forms
Alan
external usenet poster
 
Posts: 459
Default sum combo box based on other combo box



"Arvin Meyer [MVP]" wrote:

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


"Alan" wrote in message
...
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



.

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




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.