Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress Printing of a Report Row 1

Status
Not open for further replies.

Trob70

Programmer
Sep 25, 2012
89
AU
I have a row on a report with several text fields eg Field1 Field2 Field3 (note Onetime is not a field on this row)

If a field in the field list eg ONETIME="R" THEN

I would like to suppress the printing of the whole row (line) in the report'

Have had a real good look for a solution buthav not found an exact solution


Appreciate any help


Trob



 
I believe you can cancel the format event
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
     If me.onetime = "R" then C
        Cancel = True
     end if 
End Sub
 
Thanks Majp,

Not sure how to implement this

The report has several rows of data..ie 5 rows..

I need to put a different conditions on each seperate line....

If you have time would appreciate any ideas

Regardss Trob



 
I do't understand "Onetime is not a field on this row" since every row in a report has the same fields. Why can't you add a criteria to the report's record source that filters out records?

Duane
Hook'D on Access
MS Access MVP
 

Sorry if i have not explained properly..

The report has eg on several lines ..the field names are eg

Terms1
Terms2
Terms3
Terms4
Terms5

If another field in the fieldlist eg Onetime = "R"



Only Terms1 Prints.... If Onetime="O" Then all the 5 lines print



Regards Trob
 
Do you expect to close up the gap left by the hidden controls?
If the value of [OneTime] is "R" then are the Terms2-Terms5 fields Null?

I expect I would create a group footer on the primary key of the record source of the report. Place the Terms2-Terms5 controls in this group footer section. Then use code to cancel the printing of the section based on the value of [OneTime].

Duane
Hook'D on Access
MS Access MVP
 
dhookom

Thanks for your reply..

Yes..I do need to suppress the gap left in hidden controls.

Its a pity that access does not have a function to simply conditionally print a row.

Your idea of a group footer seems to be the best way.

Thanks for your help


Regards Trob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top