Dynamic fields reference

tuna

Registered User.
Local time
Today, 22:56
Joined
Mar 31, 2010
Messages
27
Hi, is there a way to refer to form fields (not controls) dynamically through a variable? I am able to make absolute references to fields, i.e. like Me.tblA_Field1, but I need really to be able to make dynamic references like Me.VarContainingTable_VarContainingField.

I'm not really sure what collection these fields are part of otherwise I could use a reference like that of the controls collection i.e. Me.Controls("..."). Is there such a collection so I can do for example Me.Fields("...")?

Thanks.
 
A form has a Recordset property which--if the form is bound--contains a recordset, which contains a collection of field objects. Code on the form can reference these fields by name with syntax like ...
Code:
Debug.Print Me.Recordset.Fields("FieldName")
 

Users who are viewing this thread

Back
Top Bottom