From: Alan on 23 Mar 2010 07:45 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
From: Stefan Hoffmann on 23 Mar 2010 08:09 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 <--
|
Pages: 1 Prev: Medium Date format and calendar in Access 2007 Next: showing images |