two parameter query

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

Guest

I have one table with many fields and to narrow down the search I would like
to be able to set a few parameters. and then have the information open up in
a form, without the user seeing any of the query windows.

tblreport_OLD
fields to set parameters, contaminant
department
Job title
I have tried but it keeps giving me all the data not just what I specified.
I am using Access 97, and am new at this.
 
Try this and use as records source for the report --
SELECT YourTable.*
FROM YourTable
WHERE (((YourTable.department)=[Enter Department]) AND
((YourTable.contaminant)=[Enter Contaminant]) AND ((YourTable.[Job
title])=[Enter Job Title]));
 
I must have done something wrong

SELECT tblreport_OLD.*
FROM tblreport_OLD
WHERE ((( tblreport_OLD.department)=[Enter Department]) AND
(( tblreport_OLD.contaminant)=[Enter Contaminant]) AND (( tblreport_OLD.[Job
title])=[Enter Job Title]));

A parameter comes up tblreport_OLD.department, and if I click again enter
department pops up, same as with job title. When I enter information nothing
comes up just a blank table.



KARL DEWEY said:
Try this and use as records source for the report --
SELECT YourTable.*
FROM YourTable
WHERE (((YourTable.department)=[Enter Department]) AND
((YourTable.contaminant)=[Enter Contaminant]) AND ((YourTable.[Job
title])=[Enter Job Title]));


mwest said:
I have one table with many fields and to narrow down the search I would like
to be able to set a few parameters. and then have the information open up in
a form, without the user seeing any of the query windows.

tblreport_OLD
fields to set parameters, contaminant
department
Job title
I have tried but it keeps giving me all the data not just what I specified.
I am using Access 97, and am new at this.
 
mwest said:
I have one table with many fields and to narrow down the search I would like
to be able to set a few parameters. and then have the information open up in
a form, without the user seeing any of the query windows.

tblreport_OLD
fields to set parameters, contaminant
department
Job title
I have tried but it keeps giving me all the data not just what I specified.
I am using Access 97, and am new at this.


If users can enter selection information, they will need to
see something where they can enter the values. This is
normally done by using a form with text or combo boxes for
them to specify the selection criteria along with a button
to open the report (the button wizard will generate the
button's Click event procedure for you).

You can then set the query's criteria to reference the form
controls instead of poping up parameter prompts. The
criteria will be like:
Forms!nameofform.nameofcontrol
 
A parameter comes up tblreport_OLD.department, and if I click again enter
department pops up, same as with job title. When I enter information nothing
comes up just a blank table.

This would suggest that tblreport_OLD does not contain a field named
department. Check the spelling in both the query and the table
definition!

John W. Vinson[MVP]
 
Back
Top