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

How to hide details on subreport based on value from MainReport

Status
Not open for further replies.

tasawer

Programmer
Aug 12, 2010
13
GB
Hi,
I have a two main reports ('Maintenance' and 'RepairsInvoice'). they use the same sub report (MaintenanceDetails) that lists all the purchases with grouping.
As long as I don't implement the options listed below, all is fine.

mainreport has field: 'HidePrices: Yes/No'
SubReport has field: 'ShowOnInvoice: Yes/No'
Fields to be controlled by ShowonInvoice are:
txtPartDescription
SellPrice
Qty
VATRate

I have other fields that are not visible but require to be there.

The list of issues is:
For my sub report, there are certain items that I do not wish to be listed. in the Details Event On Format Section, I have: 'me.sellprice.visible=me.showoninvoice' etc.
The problem is that when printed, the whole list contains blank lines where there should be data.

1. how do I get rid of the blank lines during printing?

When the option group has no corresponding data, it is not shown on the printed invoice. However, when it does have one item of data and its 'ShowonInvoice=False', option group is printed but a blank line underneath.

2. how do I get to eleiminate this?

On my main report, I have a boolean field, 'HidePrices'. When this is set to true, I need to hide all the prices on subreport, irresepecitve of 'ShowOnInvoice' state.

3. How do I achieve this? bear in mind that there are two main reports.

Thank you in advance for your expert help and advice
 
Do you have any "Can Shrink" property set to Yes?
Have you tried implementing this in your Record Sources?
Are you hiding individual controls or entire records?

Duane
Hook'D on Access
MS Access MVP
 
I ma working on Access 2003

I have not set Shrink Property.. I will ook at this option
Implementing in the records is not possible as it couold affects the totals
I am hiding individual controls.. How do i hide the record?
 
You could hide a record in the detail section with
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Cancel = [Your Condition Here]
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top