Using form to fill in query criteria not working

N

Nih

I am using Access 2007. Nothing that i have read on this subject has helped
me. I have a small database to show which departments have access to which
reports. I have 2 tables, "Reports" shows all the info I need in the
database ie. department, report name, report id

The second table "Dpt List" just has all 25 department's names and is used
to add a new record to the main table, for example i can choose the
department name from the Dpt List table on a form, enter the report name and
report id and it will add the new record to the main "Reports" table.

I don't want to have to set up a query and report for each of the 25
departments so I set up 1 query called "By Dept", I just want to choose the
department i want from a dropdown combo box and have that combo box fill in
the criteria on the query.

What I have done is created an unbound form with a combo box that shows all
the departments from the Dpt List table, the combo is called combo12. I also
have a button on the form that runs the query "By Dept". I open my form,
choose a dept from the drop down list, and hit the run button and it opens up
the "By Dept" query but it is blank. The code in the criteria section of the
By Dept query is [Forms]![frm Dept]![Combo11]

Is this no longer available in Access 2007 or am I doing something wrong?
 
J

Jeff Boyce

Still available ...

Any chance there's a "lookup datatype" field in one of the related tables?
This causes considerable confusion when it comes to working with the data...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
N

Nih

There are only the 2 tables and both were just pulled in from Excel so I
don't think there is a lookup datatype field but I will double check.

Jeff Boyce said:
Still available ...

Any chance there's a "lookup datatype" field in one of the related tables?
This causes considerable confusion when it comes to working with the data...

Regards

Jeff Boyce
Microsoft Office/Access MVP

Nih said:
I am using Access 2007. Nothing that i have read on this subject has
helped
me. I have a small database to show which departments have access to which
reports. I have 2 tables, "Reports" shows all the info I need in the
database ie. department, report name, report id

The second table "Dpt List" just has all 25 department's names and is used
to add a new record to the main table, for example i can choose the
department name from the Dpt List table on a form, enter the report name
and
report id and it will add the new record to the main "Reports" table.

I don't want to have to set up a query and report for each of the 25
departments so I set up 1 query called "By Dept", I just want to choose
the
department i want from a dropdown combo box and have that combo box fill
in
the criteria on the query.

What I have done is created an unbound form with a combo box that shows
all
the departments from the Dpt List table, the combo is called combo12. I
also
have a button on the form that runs the query "By Dept". I open my form,
choose a dept from the drop down list, and hit the run button and it opens
up
the "By Dept" query but it is blank. The code in the criteria section of
the
By Dept query is [Forms]![frm Dept]![Combo11]

Is this no longer available in Access 2007 or am I doing something wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top