Print specific information

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

Guest

Hi,
I designed a database of my school's learners. I have designed a classlist
report, but it gives me all the learners in the school. How can I set it up
that it will only print specific classes (e.g. only Room 1A) . I know I can
do it through a query, but the I have to set up one for each class. I need a
field before the report opens where I can just type in the class Number I
need to print.
Thank You
 
one simple and standard way to do this is using a query whose criteria
refers to a control on a form.

1. write the query, to pull *all* the records, making sure to include the
field (class Number, for instance) that you want to filter on.
2. create a report, based on the query.
3. create an unbound form (i'll call it frmQueryCriteria), and add an
unbound textbox to it (i'll call it txtClassNumber).
4. open your query in design view, and on the criteria line of the class
Number field, set the criteria as

Forms!frmQueryCriteria!txtClassNumber

now you can open the form, enter a class number in the control, then open
the report while the form is still open. the query will filter the records,
and show only records for that class Number in your report.

hth
 
MasterJack said:
Hi,
I designed a database of my school's learners. I have designed a classlist
report, but it gives me all the learners in the school. How can I set it up
that it will only print specific classes (e.g. only Room 1A) . I know I can
do it through a query, but the I have to set up one for each class. I need a
field before the report opens where I can just type in the class Number I
need to print.
Thank You

The easiest way to do this is to set the parameters in the underlying query.
To do this:
Open the query in design view
Click on Query on the Menu bar
Click on Parameters -- this will open the parameters window
In the first Parameter field, type in "Class Number" (for example) <TAB>
Select the data type for that field <TAB>
In the second Parameter field, type in "Class Number 2" <TAB>]
Select the data type for that field and click on OK.
Stay in design view of the query. In the "Class Number" field type this
into the first criteria row:
Between [Class Number] and [Class Number 2]
Now run the query to test it. It will prompt you to enter the first class
number. Type it in and then press ENTER. It will prompt you to enter the
second class number. Type it in and then press ENTER.
If you only want one class at a time, type that class number in at each
prompt. For example: If you only want class 1A, type 1A in the first prompt
and 1A in the second.
Save your query and open the report. When you open the report, it will
prompt you to enter the beginning and ending class numbers, and when your
report opens, it should have the correct data.
 
Back
Top