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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Looking up 2 combo boxes and then calculate another field
Hi can anyone help
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 , sorry if it seems confusing |
#2
|
|||
|
|||
Looking up 2 combo boxes and then calculate another field
hi Alan,
On 23.03.2010 12:45, Alan wrote: 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 Use DSum() as ControlSource of your TextBox: =DSum("Amount", "yourTable", "CustomerNumber = " & cboCustomer.Value & " AND Format(dateField, "yyyymm) = '" & Format(cboDate.Value, "yyyymm") & "'") This should work, if your customer number is a number and not text and if your date combo box really selects a date. mfG -- stefan -- |
Thread Tools | |
Display Modes | |
|
|