using combo boxes to filter records

umair434

Registered User.
Local time
Yesterday, 21:11
Joined
Jul 8, 2011
Messages
186
Hi,

I am using a couple of cascading combo boxes to filter a list box which contains bunch of reports. Each report is based on query.

Here is the situation:

the user first selects Type of Employees "day or night" from combo

then employees names comes:

the list box will show the reports and I can double click it which opens the report for the desired employeeID

Required:
If user does not select any employee name, then the report should show records for all the employees. OR an "ALL" option in the Employeename combo box, which upon clicking, shows all records.


how can I achieve this?

thanks :)
 
What does the criteria in your query look like for the fields you are trying to filter on. I suspect that you are missing an ampersand and a wildcard indicator in your criteria, ie.

& "*"

but really need to see what you have.
 
SELECT tblActivities.dte, Val(DatePart("ww",[dte],7,3)) AS Week, Sum(tblActivities.[High Cube Available]) AS [SumOfHigh Cube Available], Sum(tblActivities.[High Cube Actioned]) AS [SumOfHigh Cube Actioned]

FROM Slotters, tblActivities INNER JOIN tblEmployees ON tblActivities.EmployeeID = tblEmployees.EmployeeID

WHERE (((Slotters.SlottersID)=[forms]![main]![combo3]) AND ((tblEmployees.EmployeeID)=[forms]![main]![combo]))
GROUP BY tblActivities.dte, Val(DatePart("ww",[dte],7,3));


this is my query for 1 of the reports. Combo = combo box for EmployeeID

combo1 = combo box for employeename

combo3 = type of employees (night or day)


thanks!
 
Try changing the Where statement in your Query (this is the criteria in the QBE) from:

WHERE (((Slotters.SlottersID)=[forms]![main]![combo3]) AND ((tblEmployees.EmployeeID)=[forms]![main]![combo]))
to
WHERE (((Slotters.SlottersID) LIKE [forms]![main]![combo3]) & "*" AND ((tblEmployees.EmployeeID) LIKE [forms]![main]![combo] & "*"))

If nothing is selected in the combo boxes, then the query should return all records.

Alan
 

Users who are viewing this thread

Back
Top Bottom