Suppress fields and lables in report

torquay

Registered User.
Local time
Today, 22:49
Joined
Dec 27, 2005
Messages
85
Hopefully someone can guide me in the right direction.
On my forms I have the customers info and the products they have purchased along with
Sub-total
Delivery
Discount
VAT
Total

When my invoice prints it has all of the above fields.
What I would like to be able to do is to suppress any field (and associated label) that shows £0.00 (as not everyone gets discount as an example) and if possible move any other fields up to take up any extra space.
Thank you in advance.
 
I think you could test the value of the field when the form opens with an if statement that then hides or shows the field depending on the criteria e.g.

Sub Form_Open
If Me!Total = 0 Then
Me!Total.Visible = False
Else
Me!Total.Visible = True
End if
Close Sub

This should also move up the data below if it is hidden. Hope this helps.
Regards
 
Thank you James that worked fine with suppressing the fields but I am now left with a gap where the fields are. The fields underneath did not move up, any ideas? Thanks again
 
Can you filter out the £0.00 in the where clause for the report control source or query?
 
Set the cangrow/shrink properties to yes
 
I think what Rich suggested works although I have not used it.

I have very little to do with reports as I use Word for the printed output and my suggestion is based on forms.

Sub-total
Delivery
Discount
VAT
Total

It would appear that Discount complicates things because it in the middle.

So could you base those text box values on an IFF entry such as for Discount

IFF([Discount Field]>0,enter the discount, enter the Vat, thus that will move the VAT amount up one box

For VAT textbox

IFF([DiscountField]>0, enter total amount, enter the Vat

For Total Box

IFF([Discount Field]>0, Null, total calculation.

So in essence your Discount, Vat and Total would be calculated in hidden texboxes and the display textboxes get the result of the IIF. You could use Conditional Formatting (assuming Reprt is continuous) to effectively hide the Total texbox when Null by transparent background and borders.
 
PS.

I forgot another alternative.

If the Report is for a single person then you could make two Reports, one for Discount >0 and Discount = 0 and that condition triggers which Report is printed
 

Users who are viewing this thread

Back
Top Bottom