Offering a choice when running a query

E

emanuel.levy

I have a table with tasks assigned to employees. Two employees are
assigned to one task. I want to write a Query that when run gives them
a drop down type of box with the employee names and when they click on
the name it will show all the tasks assigned to them.

I've tried searching the groups but I must be using the wrong criteria.
 
R

Rick B

You can't use a drop-down in a query as criteria. You could have them type
in the employee name and use it as the criteria. Something like...

Like "*" & [Enter Partial Employee Name] & "*"



If you want to use a drop-down, then you will have to create an unbound form
and add a drop-down field there, then reference that field in your query.
This is typically called a "parameter form".
 
E

emanuel.levy

Ok I used your code in the Criteria field

Like "*" & [Enter Partial Employee Name] & "*"
so the design looks like

field: S Employee Assigned
Table: tbl_Employers
Sort <blank>
Show <Checked>
Criteria Like "*" & [Enter Partial Employee Name] & "*"

I made a new record with an employee name A Dummy assigned to it that
meets the other criteria but when I run the query it comes back blank
what I am I missing?

on the tbl_employers the S Employee Assigned field is coded text and is
a Display Control of Combo Box with a Row Source Type of Table/Query
with a row Source of

SELECT tbl_safety_Employees.tblSaftey_EmployeesID,
tbl_safety_Employees.[First Initial], tbl_safety_Employees.[Last Name]
FROM tbl_safety_Employees;
 
R

Rick B

If you take out the criteria and run the query, what appears in that column?

Is it the employee name, or their ID?
 
R

Rick B

And if you put in my criteria, and enter "A" when prompted, you don't get
the records?
 
E

emanuel.levy

I have the Email addresses along with names in a seperate table is
there any way to run the query by E-mail address rather than name trhat
may solve it
 
R

Rick B

Sure, just pull that table into the upper section of your query and drag the
email field down to the list of fields in your query.
 
E

emanuel.levy

OK I tried that and I either wrote my query wrong or there is something
I'm overlooking because I tried to run a query by E-mail address using

Like "*" & [Enter Safety Employee's Email Address] & "*"

as the Criteria entry for Email address it it comes back with nothing
 
Top