G
Guest
Hello,
I am populating a form and wondered how to populate the fields on the form
through dynamically accessing the fields in the dataset.
In this case, I have field1, field2, field3 on the form, which correspond to
fields in the recordset I am querying.
While I can dynamically access the fields on the form, how do I do the same
to get the field in the recordset.
See the code below:
i = 1
Do Until i = 11
Labeltext = "cboCustomField" & Trim(Str(i)) & "Name_Label" ' field
on the form)
Labeltext2 = "CriteriaDesc" & Trim(Str(i)) ' field in the file
Me(Labeltext).Caption = rst![Labeltext2] 'GET ERROR HERE, DOES NOT
RECOGNIZE CriteriaDesc1, CriteriaDesc2... at a valid field name in the
recordset
I've tried rst!(Labeltext2).Value and rst!(Labeltext2).UnderlyingValue.
Any ideas?
Thanks,
--David
I am populating a form and wondered how to populate the fields on the form
through dynamically accessing the fields in the dataset.
In this case, I have field1, field2, field3 on the form, which correspond to
fields in the recordset I am querying.
While I can dynamically access the fields on the form, how do I do the same
to get the field in the recordset.
See the code below:
i = 1
Do Until i = 11
Labeltext = "cboCustomField" & Trim(Str(i)) & "Name_Label" ' field
on the form)
Labeltext2 = "CriteriaDesc" & Trim(Str(i)) ' field in the file
Me(Labeltext).Caption = rst![Labeltext2] 'GET ERROR HERE, DOES NOT
RECOGNIZE CriteriaDesc1, CriteriaDesc2... at a valid field name in the
recordset
I've tried rst!(Labeltext2).Value and rst!(Labeltext2).UnderlyingValue.
Any ideas?
Thanks,
--David