Print the record only if there is data in a field

S

Scott

I would like to print the records only if there is data in a field or the
field matches certain criteria of the record. How can I accomplish it?

Thanks!

Scott
 
M

Marshall Barton

Scott said:
I would like to print the records only if there is data in a field or the
field matches certain criteria of the record. How can I accomplish it?


Use a query for the report's record source and specify the
desired filtering in the query field's criteria.
 
S

Scott

Marshall,

Thanks for your advice. I need to calculate both the total records and the
selected records on the reports but print the selected records only. With
this method, I cannot calculate the total records. Any other option to find
out the total?

Thanks,

Scott
 
M

Marshall Barton

The total number of records in a table is a separate
operation from counting the (filtered) records in the
report.

The number of records in the report's dataset can easily be
calculated in the report's header/footer sectio simply by
using a text box with the expression =Count(*). Then same
expression can be used to count the records in a group
(header or footer).

A simple text box expression to count the number of records
in a table is =DCount("*", "table") and that can be
modified to cound records using a different filter than the
report itself. E.g. =DCount("*", "table", "FY=2006")
 
S

Scott

Marshall,

Many thanks for your useful advice.
The total number of records in a table is a separate
operation from counting the (filtered) records in the
report.

Oh it is new to me.
The number of records in the report's dataset can easily be
calculated in the report's header/footer sectio simply by
using a text box with the expression =Count(*). Then same
expression can be used to count the records in a group
(header or footer).

Duly noted.
A simple text box expression to count the number of records
in a table is =DCount("*", "table") and that can be
modified to cound records using a different filter than the
report itself. E.g. =DCount("*", "table", "FY=2006")

I need the syntax for the following

FieldA(TextType) is not null And
FieldB(DateType) is between [Start date] and [End date] from a select and
parameter query.

Under above senerio, I have to take query instead of table!

Scott
 
M

Marshall Barton

Just use the query instead of the table in the DCount.
--
Marsh
MVP [MS Access]

Many thanks for your useful advice.
The total number of records in a table is a separate
operation from counting the (filtered) records in the
report.

Oh it is new to me.
The number of records in the report's dataset can easily be
calculated in the report's header/footer sectio simply by
using a text box with the expression =Count(*). Then same
expression can be used to count the records in a group
(header or footer).

Duly noted.
A simple text box expression to count the number of records
in a table is =DCount("*", "table") and that can be
modified to cound records using a different filter than the
report itself. E.g. =DCount("*", "table", "FY=2006")

I need the syntax for the following

FieldA(TextType) is not null And
FieldB(DateType) is between [Start date] and [End date] from a select and
parameter query.

Under above senerio, I have to take query instead of table!

 

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