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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detail section of a report 1

Status
Not open for further replies.

primerov

Technical User
Aug 16, 2002
160
BG
Can i programatically remove the detail section of a report?

I have a report showing the offers and the details of the offers.I want to combine in one report
these 2 possibilities.Is it possible ?

For example, if i want the full details of a report, i must have 2 sections.
In the section called OfferIDHeader i have the following fields:

OfferID, offer date, clientname, city

In the section called Detail section i have the details of the offer, including different products and their

prices.:

Productid, size,pack,unitprice

Can i programatically remove the detail section, and see only the offer number , the offer date and the

client name?
I want to do it through a button on a form.
i will be very grateful for any advice

 
What you want to do is change the Reports Detail Section visible property to False to keep the section from printing.

Reports!ReportName.Section(0).Visible = False

The above example is the format for adjusting the Section's visible property. This code can be placed in the On Open event procedure of the Report.

Now the code to do this from a form would include this code in the form. We have to set a readable trigger for the report to know which option you want to execute. The easiest way is to set a variable in the form when you click the button to make the section invisibile and have the report respond to its value and set the property one way or the other. So in a database module create a public variable called:

Dim vDetailVisible as Boolean

Now in the OnClick event procedure of your forms button put the following code:
vDetailVisible = false
In the OnClick of the button to print the full report put this code:
vDetailVisible = true

Now in the On Open event procedure of the report put the following code:
If vDetailVisible then
Reports!ReportName.Section(0).Visible = True
else
Reports!ReportName.Section(0).Visible = False
end if

This should solve your problem.
Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top