Printing Report from Records in Forms

  • Thread starter Thread starter Indu Aronson
  • Start date Start date
I

Indu Aronson

I have a data entry form with a check mark for the Books
field.

If I have entered 8 records and only three of them are
books, how can I preview just the three items where the
box for Books are checked?

Table Name: tblCollection
Form Name: frmCollectionDE
Report Name: rptCollection

I can display all records in tblCollection in the report
or I can display the current record in frmCollectionDE in
the report. However, I don't know how to display just the
reports that have Books checked in the current Data Entry
form. Can anyone help?

I am using Access 2002.

Thanks for your help.
 
Hi Indu

Use the fourth argument of OpenReport (WhereCondition) to specify the
selection criteria:

DoCmd.OpenReport "rptCollection", acViewPreview, , "[IsBook]<>0"

This assumes you have a boolean (Yes/No) field named "IsBook". To test for
"No" in a blloean field, check for equal to zero. To test for "Yes", check
for not equal to zero (<>0).
 
Graham, thank you very much for your help. However, what
I get is everybook in the database rather than just the
ones in the data entry form. I might have to create
another field that acts as a tag and then I could use
your code to preview just the records that I want.

Thanks you very much for your help and clear directions!
-----Original Message-----
Hi Indu

Use the fourth argument of OpenReport (WhereCondition) to specify the
selection criteria:

DoCmd.OpenReport "rptCollection",
acViewPreview said:
This assumes you have a boolean (Yes/No) field named "IsBook". To test for
"No" in a blloean field, check for equal to zero. To test for "Yes", check
for not equal to zero (<>0).
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have a data entry form with a check mark for the Books
field.

If I have entered 8 records and only three of them are
books, how can I preview just the three items where the
box for Books are checked?

Table Name: tblCollection
Form Name: frmCollectionDE
Report Name: rptCollection

I can display all records in tblCollection in the report
or I can display the current record in frmCollectionDE in
the report. However, I don't know how to display just the
reports that have Books checked in the current Data Entry
form. Can anyone help?

I am using Access 2002.

Thanks for your help.


.
 
Back
Top