Hide label based on footer total

scouser

Registered User.
Local time
Today, 15:56
Joined
Nov 25, 2003
Messages
767
Hi to all. I have a report with label 'Receipt' + 'Receipt Number' + 'Order ID'. I have added a label 'Payment Due'.

When the order balance is >0 I want to hide label 'Receipt' + 'Receipt Number' + 'Order ID' and display 'Payment Due'.

When order balance is 0 I want to display label 'Receipt' + 'Receipt Number' + 'Order ID' and hide 'Payment Due'.

Can this be done in Access?

Sample DB attached.
Thanks
Phil.
 

Attachments

I have tried the following in the 'On Load' event of the report.

Code:
Option Compare Database

Private Sub Report_Load()
IF Me.OrderBalance >0 Me.PaymentDueLabel.Visible = False
End Sub
 
OK, I have worked it out.

Code:
Option Compare Database

Private Sub Report_Load()
If Me.OrderBalance > 0 Then Me.PaymentDueLabel.Visible = True
If Me.OrderBalance = 0 Then Me.PaymentDueLabel.Visible = False

If Me.OrderBalance > 0 Then Me.ReceiptLabel.Visible = False
If Me.OrderBalance > 0 Then Me.ReceiptNumberLabel.Visible = False
If Me.OrderBalance > 0 Then Me.OrderID.Visible = False

If Me.OrderBalance = 0 Then Me.ReceiptLabel.Visible = True
If Me.OrderBalance = 0 Then Me.ReceiptNumberLabel.Visible = True
If Me.OrderBalance = 0 Then Me.OrderID.Visible = True
End Sub

I was missing the Then.
Thanks,
Phil.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom