Conditional tests in Access Reports

G

Guest

I want to create a report that will not print only those fields with data in
them. How can I build a conditional test into the report?
 
R

RBear3

"not print only those fields with data in them"? I assume yo mean that you
DO want to print the itmes with data in them, and exclude those that are
blank.

This is pretty much what you r query is for. Base your report on a query
and in that query, select only the records that you wish to appear on the
report.

If that does not answer your question, you may need to give us an example of
how your data is set up and an example from the report of what is printing
that you wish to supress.
 
F

Franck

You cannot create conditionnal to not print specific record. You can
only not show it putting the condition into a query like RBear3 said.
but you could always put tet color to white if X condition happen but
it will still take the a full line in your report because there is a
record it's just white text so it's not printed.
 
G

George Nicholson

You can add VBA code to the Format (not Print) event of the appropriate
report section. For a record, that would probably be Detail_Format.

You can set individual controls Visible or not per some conditional. If
CanShrink is True and the layout is set correctly, you can "skip" a record
with no empty whitespace line if all the controls on that line are invisible
and allowed to shrink. Just be sure that your conditional sets Visible to
True as well as False, or you'll be hiding more than you intended.

Pretty sure you can also could also set the entire Detail section invisible
for specific records via code. Foggy memory.

You could also apply a filter to the report recordset during Report_Open to
exclude certain records.

*Usually* the best approach is that suggested elsewhere in this thread: Have
your query include only the records you want to print.
However, 'usually' is not the same as 'always' and there are alternative
approaches.

HTH,
 

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