Month Filtering

jamesormi

Registered User.
Local time
Today, 10:50
Joined
Nov 19, 2008
Messages
20
Hi,

I have a form that shows a number of jobs done for a customer. Each job has a date. I would like to filter the form to show the jobs done in a month for each customer. I would also like my combo box (on which the filter will be applied) to only show the months where a job was done for the customer.

Any help would be appreciated.

Thanks in advance.
 
Got to the rowsource of the combo box and create a query that groups by month or date where customer id = nn. now when you select a customer set the rowsource property accordingly.

Example

Code:
Me.ComboBox.RowSource = "SELECT Format([fldJobDate],"mmmm yyyy") AS Period, "(" & Count(1) & ")" AS Cnt
FROM tblCustData
WHERE CustID = " & Me.TxtCustomer & " " & 
GROUP BY Format([fldJobDate],"mmmm yyyy"), Format([fldJobDate],"mmyyyy")
HAVING (((Format([fldJobDate],"mmyyyy"))>"0"));

This will only display the months containg activity and the number of occurances found for the selected customer.

David
 

Users who are viewing this thread

Back
Top Bottom