Query a Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Currently i have a query with the conditions on the date i.e. the user has to
enter the beginning and end dates of the data wanted. This is done using
'Between' in the criteria.

I am now looking to add another criteria, the name of the employee. What do
i use? Do i need to create another table with all the name of the employees?

Thanks
 
Do you have a table that already exists with employee names on it? if not
then you will need to create one and it needs to have a relationship with
something that is in the query already e.g.

EmployeeID might be linked to a field EmployeeID in a table of training

You will then add to your query this new/existing table and add criteria
under the employee name field

If you need any further assistance post back
 
Currently a dialog box pops u asking me the dates i want, i would like
another one to appear asking me which employee i want to query?
 
Is this a part of the same query or a different one?

Are you making your query in the design grid or SQL?

Do you have an existing table with employee names?
 
The Same query

In the design grid

Yes i do
Falty said:
Is this a part of the same query or a different one?

Are you making your query in the design grid or SQL?

Do you have an existing table with employee names?
 
Well i'm assuming that the table is in some way linked to the other things
being queired in the query. Simply right click in the free space to the first
table on the design grid, then select show table. Pick the users table, add
the user name field then add your criteria
 
I understand adding the table,

But what command do i enter in the criteria space for it to promt me when i
open the query to specify the employee name
 
I would suggest a rethink on this idea as if people are entering names
without any kind of validation chances are there will be a spelling mistake
and therefore the query will return nothing. You could maybe create a form
which has a combo box of employees, and a space for start date and finish
date. You would then have a button to press that would run the query / report
generated by the query.

What you would then have to do with the query is reference to controls on
the form

so for Employee name on the query you would enter this in for the criteria

forms!NameOfForm!EmployeePick

this is where
NameOfForm = the name of the form you create
EmployeePick = the control on the form where you select the employee

If you must do it from the query itself then you can simply enter a message
between two square brackets for e.g.

[Please Enter Employee Name]
 
Thanks

Works so much better

Cheers

Falty said:
I would suggest a rethink on this idea as if people are entering names
without any kind of validation chances are there will be a spelling mistake
and therefore the query will return nothing. You could maybe create a form
which has a combo box of employees, and a space for start date and finish
date. You would then have a button to press that would run the query / report
generated by the query.

What you would then have to do with the query is reference to controls on
the form

so for Employee name on the query you would enter this in for the criteria

forms!NameOfForm!EmployeePick

this is where
NameOfForm = the name of the form you create
EmployeePick = the control on the form where you select the employee

If you must do it from the query itself then you can simply enter a message
between two square brackets for e.g.

[Please Enter Employee Name]


--
Let me know how you get on
If i have helped please let me know

Falty


SGTPEP said:
I understand adding the table,

But what command do i enter in the criteria space for it to promt me when i
open the query to specify the employee name
 
Back
Top