Fields Collection

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
 
M

Maurice

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
 
K

krissco

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
 

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