How do you reference names in reports?

A

Andreas

In a form, in order to hide or show an item based on the value of a
variable, I do the following:
If [InvoiceCustDetails].[Discount] = 0 Then

Discount.Visible = False

Else

Discount.Visible = True

End If





In the report, it doesn't recognize my [Discount] variable. How should I
reference it?
 
A

Allen Browne

Andreas, that should work in a report, provided:

a) There is a control named Discount (not just a field), and

b) You put this code in the Format event of the section the Discount control
is in.

It might be more efficient to use Conditional Formatting and use (say) white
text.
 
A

Andreas

Thanks a lot, it was your 2nd suggestion. I had to put it in the Format
event of the section the Discount control
is in.

I was using the form load event.



Allen Browne said:
Andreas, that should work in a report, provided:

a) There is a control named Discount (not just a field), and

b) You put this code in the Format event of the section the Discount
control is in.

It might be more efficient to use Conditional Formatting and use (say)
white text.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Andreas said:
In a form, in order to hide or show an item based on the value of a
variable, I do the following:
If [InvoiceCustDetails].[Discount] = 0 Then
Discount.Visible = False
Else
Discount.Visible = True
End If

In the report, it doesn't recognize my [Discount] variable. How should I
reference it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top