Suppressing particular detail lines for blank data

S

Steve

I have a report based on a query where a number of the data elements are
Nulls. I would like to suppress the detail when certain conditions are
met, ie, certain fields are Null. When I try to set
Detail.Visible = False, I get NOTHING printed for any record line.

I suppose I could redo the query to eliminate this, but I use the same
query for other reports, and I'd like to minimize the complexity if
possible.

Thanks

Steve
 
R

Rick Brandt

Steve said:
I have a report based on a query where a number of the data elements
are Nulls. I would like to suppress the detail when certain
conditions are met, ie, certain fields are Null. When I try to set
Detail.Visible = False, I get NOTHING printed for any record line.

I suppose I could redo the query to eliminate this, but I use the same
query for other reports, and I'd like to minimize the complexity if
possible.

Thanks

Steve

In the format event of the relevent section...

Cancel = IsNull(Me.SomeField)
 
M

Marshall Barton

Steve said:
I have a report based on a query where a number of the data elements are
Nulls. I would like to suppress the detail when certain conditions are
met, ie, certain fields are Null. When I try to set
Detail.Visible = False, I get NOTHING printed for any record line.

I suppose I could redo the query to eliminate this, but I use the same
query for other reports, and I'd like to minimize the complexity if
possible.


If you use a form button to initiate the report, then you
can filter the report's data by using the OpenReport
method's WhereCondition argument:

stDoc = "reportname"
stWhere = "fldA Is Not Null AND fldB Is Not Null"
DoCmd.OpenReport stDoc, , , stWhere
 
S

Steve

BINGO! That works great! Thanks.

So why is this nowhere to be found in the docs??? <g>

Steve
 

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