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!

Display only fields containing data in a report 1

Status
Not open for further replies.

markswan20

Technical User
Jun 17, 2005
58
GB
Hi everyone.

Is it possible when using reports to only display data that contain information?

My report has 7 fields 1 field will always have information in but the others are blank when i print my report i only want it to print the lines with data in the fields so blank ones are not.

Is this possible?

Kind Regards
Mark
 
Something like this?
[tt]
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.FieldName = "" Then Cancel= True
End Sub
[/tt]

________________________________________________________________________
Zameer Abdulla
Visit Me
No two children are alike - particularly if one is yours and the other isn't.
 
Thank you for you reply ZmrAbdulla

Where would I attach the code?

Kind Regards
Mark
 
Just paste it into the code window. Also remember to change the "FieldName" to actual field name

________________________________________________________________________
Zameer Abdulla
Visit Me
No two children are alike - particularly if one is yours and the other isn't.
 
Apologies if I sound a little slow,

When you say code window, is that it the top left corner of the report?

If so under which option within the window?

Apologies

Kind regards
Mark
 
When you are at the design view of the report

Menu VIEW > CODE


________________________________________________________________________
Zameer Abdulla
Visit Me
No two children are alike - particularly if one is yours and the other isn't.
 
Thank you very much Zameer.

It works better than expected.

I have a command button that prints my report. Makes life easy, is it possible to have a form popup that lets you specify the date range you want displaying on the report?

Thanks very much

Mark
 
Open the Northwind sample DB that ships with MS Access. It has the sample that you require

________________________________________________________________________
Zameer Abdulla
Visit Me
No two children are alike - particularly if one is yours and the other isn't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top