Fields Collection

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I need to make a symbolic reference to one of the
fields in a report's RecordSource. I.e.,

Me.Fields(strMyFieldName)

The above reference is invalid, but I don't know
what other method to try?

Thanks for any help,
Bill
 
try:

dim strMyfieldname AS String

strMyFieldname=me.field

where the field is the field you want to reference. If you are using a
recordset and you are looping through it you can refer to it as follows:

strMyFieldname=rs("the name of your field")

hth
 
Create a control on your report of the appropriate type.

Set its Visible property to false.
Set its controsource to the field in the recordsource you desire.
Reference the control instead of the recordsource using
"Me.ControlName."

-Kris
 
Back
Top