Accessing Fields on a Report

K

Ken

I want to make sections of my report visible if there are records available.
How do you access the fields on a report.

Here is what I am trying to do

If (DCount("TugID", "tblAnnex", "TugID = " & Me.UnitID) = 0) Then
Me.Section("TugID").Visible = False
Else
Me.Section("TugID").Visible = True
End If

I keep getting a error that access can't find the field (error 2465). The
UnitID is in the query for the report.

Thanks.
 
D

Duane Hookom

Where is this code running? If it is in the report, you must have a control
bound to UnitID in the report section.
 
K

Ken

I put it in the code in the OnFormat event. I added the field to the detail
and it is working. I then added the Tug ID to the section and it works.

Thank you.
 

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