reference query field

jjohnson

New member
Local time
Today, 23:17
Joined
Mar 2, 2001
Messages
7
I have a form bound to a query. The query result has a field that I would like to reference, however I do not want the field on my form. Is there a way to reference a field in the query results that is not on the form?
 
Why not just bind an invisible field to it on your form?
 
This is where the form and report objects differ (for no reason that I can think of). In a form, you can reference ANY field in the form's RecordSource in VBA. In a report, you seem to need to add a control (hidden is fine) in order to reference a field.

In either case, if your control has a different name from its ControlSource column name, you will see both names in the intellisense list. For both forms and reports so I don't know why reports work differently.

If you are having trouble with the code not "seeing" the field, try deleting the form's RecordSource and then replacing it. This makes the form/report refresh its fields collection which is sometimes necessary if you added the column to the recordSource after you originally created the form/report.
 
Thank you for your replies.
Deleting the RecordSource and then replacing it worked. It also explains why I was sometimes able to reference a field in the RecordSource and sometimes unable to reference a field.

Thanks again
 

Users who are viewing this thread

Back
Top Bottom