Suppressing particular detail lines for blank data

  • Thread starter Thread starter Steve
  • Start date Start date
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
 
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)
 
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
 
BINGO! That works great! Thanks.

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

Steve
 
Back
Top