Accessing Fields on a Report

  • Thread starter Thread starter Ken
  • Start date Start date
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.
 
Where is this code running? If it is in the report, you must have a control
bound to UnitID in the report section.
 
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.
 
Back
Top