I have a number of reports that don't really function like classic reports. That is, much of the data is displayed in unbound text boxes laid out in a grid format, where the data is pulled directly from corresponding fields on a data entry form. I realize it's a kludge, but there are specific reasons for doing it that way. Anyway, the generic control source for each of these report fields looks something like this:
where X is a digit from 1-9 and Y is a digit from 1-5. As you can imagine, it's quite tedious to hard-code those field names in every report that uses a similar format. I would rather have a control source that's a public function and therefore the same for each field, i.e.:
where the name of the control gets passed to the function, the function gets the right data from the corresponding form, and passes it back to the control source of the report field. But I don't know how to dynamically reference the name of the field to pass as the argument. Can someone help me with the syntax? Thanks!
Ken S.
Code:
=IIf(IsNull(Forms!MB45_Form!NameRowXColY),"",Forms!MB45_Form!InstRowXColY)
where X is a digit from 1-9 and Y is a digit from 1-5. As you can imagine, it's quite tedious to hard-code those field names in every report that uses a similar format. I would rather have a control source that's a public function and therefore the same for each field, i.e.:
Code:
=GetFieldData(Me!Field.Name)
where the name of the control gets passed to the function, the function gets the right data from the corresponding form, and passes it back to the control source of the report field. But I don't know how to dynamically reference the name of the field to pass as the argument. Can someone help me with the syntax? Thanks!
Ken S.