I've been trying to contact the person that wrote "How to run queries through forms?" in FAQ's and I had no luck. Therefore I'm asking for help. I've tried doing his ex. but it does not work, When I run the query I get a blank datasheet with the Name, Position and Shift fields but no data on it.
Also in line 5 he mentions "with the control source of that form being "Employee_Query".
Where do you get the opion to see "control source" for the form (Employee_Form).
As I set it up I only get the reference ID# (auto#) in the Employees table in the name field. (weird?)
Let me show you the actual post:
How to run queries through forms?
faq702-1251
What you want to do is to create a form that list all of the positions in a combobox and run a query from the selection of that combobox.
1) Create a table called “Position” with “Position” as a field name
The data in your table such look like this:
“Position”
Manager
Supervisor
Associate
2) Create a table called “Employees” with “Name”, “Position”, and “Shift” as field names. The data in your table such look like this:
Name Position Shift
Kim Supervisor 3rd
Mike Manager 2nd
Chris Associate 2nd
3) Save the table and create a query called “Employee_Query” with the following fields:
Name Position Shift
4) Place the following criteria under the “Position” field:
=[Forms]![Employee_Form]![Position_combobox]
5) Save the query and create a form called “Employee_Form” with the control source of that form being “Employee_Query”.
6) Create a combobox using the wizard that will lookup the values in the “Position” table.
7) Name this combobox “Position_combobox”.
8) Create a button using the wizard that will run the “Employee_Query”
9) Save the Form
10) Go to design view, choose a position, and press the button.
If someone can see what's wrong please let me know.
Thanks...
Also in line 5 he mentions "with the control source of that form being "Employee_Query".
Where do you get the opion to see "control source" for the form (Employee_Form).
As I set it up I only get the reference ID# (auto#) in the Employees table in the name field. (weird?)
Let me show you the actual post:
How to run queries through forms?
faq702-1251
What you want to do is to create a form that list all of the positions in a combobox and run a query from the selection of that combobox.
1) Create a table called “Position” with “Position” as a field name
The data in your table such look like this:
“Position”
Manager
Supervisor
Associate
2) Create a table called “Employees” with “Name”, “Position”, and “Shift” as field names. The data in your table such look like this:
Name Position Shift
Kim Supervisor 3rd
Mike Manager 2nd
Chris Associate 2nd
3) Save the table and create a query called “Employee_Query” with the following fields:
Name Position Shift
4) Place the following criteria under the “Position” field:
=[Forms]![Employee_Form]![Position_combobox]
5) Save the query and create a form called “Employee_Form” with the control source of that form being “Employee_Query”.
6) Create a combobox using the wizard that will lookup the values in the “Position” table.
7) Name this combobox “Position_combobox”.
8) Create a button using the wizard that will run the “Employee_Query”
9) Save the Form
10) Go to design view, choose a position, and press the button.
If someone can see what's wrong please let me know.
Thanks...