data fields not found????

B

Bill

I have a report whose RecordSource is a simple
query:

SELECT Volumes.VolID, Volumes.CatNo, Volumes.JCEdgeTitle,
Volumes.JCEdgeBackColor, Volumes.JCEdgeForeColor
FROM Volumes;

The query runs fine producing exactly what you see
listed in the query. The Open event sets the filter to
the desired VolID, as received in the reports OpenArgs.
The reports open event fails on the MsgBox statement
(inserted for debug) complaining that the "CatNo" field
cannot be found.

I thought perhaps I needed a Me.Requery after the
filter was set, but that method isn't valid. What am I
missing here?

Option Compare Database
Dim Arg() As String
Private Sub Report_Open(Cancel As Integer)
Arg = Split(OpenArgs, ";")

Me.Filter = "VolID = " & Arg(1)
Me.FilterOn = True
Me.CenterImage.Picture = Arg(0)

MsgBox Me.CatNo & "; " & Me.JCEdgeBackColor & "; " & Me.JCEdgeForeColor &
"; " & Me.JCEdgeTitle
End Sub
 
A

Allen Browne

Try adding the CatNo field as a text box on the report. Set its Visible
property to No if you wish.

Sometimes Access is a bit too smart, and retrieves only the fields it really
needs for the report, so if there is no text box with a Control Source set
to that field, it doesn't bother fetching the field.
 
B

Bill

Allen,

I had to have bound controls on the report for ALL the
record fields that I needed to reference. I "picked them
off" one at a time! A rather subtle requirement of Access.

Thanks,
Bill
 

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