G
Guest
I have the following code on the Detail section of my report....only because
I've tried the OnOpen, Activate etc... However, when I click OK on my
parameter form (DetailedCredits) it flashes up the report preview for the
briefest of seconds and then everything closes.
When I take this code away, it works fine and stays open as normal. But...I
need this report to hide one or two of my columns depending on what is
selected on the form. I based the coding on the coding I found in Northwind.
Is there anything wrong? Can you suggest something? Thanks.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Forms!DetailedCredits!HFees = "No" Then
Me!HandlingFeeAmount_Label.Visible = False
Me!HandlingFeeAmount.Visible = False
Else
Me!HandlingFeeAmount_Label.Visible = True
Me!HandlingFeeAmount.Visible = True
End If
If Forms!DetailedCredits!Discounts = "No" Then
Me!DiscountAmount_Label.Visible = False
Me!DiscountAmount.Visible = False
Else
Me!DiscountAmount_Label.Visible = True
Me!DiscountAmount.Visible = True
End If
End Sub
I've tried the OnOpen, Activate etc... However, when I click OK on my
parameter form (DetailedCredits) it flashes up the report preview for the
briefest of seconds and then everything closes.
When I take this code away, it works fine and stays open as normal. But...I
need this report to hide one or two of my columns depending on what is
selected on the form. I based the coding on the coding I found in Northwind.
Is there anything wrong? Can you suggest something? Thanks.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Forms!DetailedCredits!HFees = "No" Then
Me!HandlingFeeAmount_Label.Visible = False
Me!HandlingFeeAmount.Visible = False
Else
Me!HandlingFeeAmount_Label.Visible = True
Me!HandlingFeeAmount.Visible = True
End If
If Forms!DetailedCredits!Discounts = "No" Then
Me!DiscountAmount_Label.Visible = False
Me!DiscountAmount.Visible = False
Else
Me!DiscountAmount_Label.Visible = True
Me!DiscountAmount.Visible = True
End If
End Sub