G
gmazza via AccessMonster.com
Hey there,
I need to reference my subform in a module I have that is creating an audit
trail. The name of the subform is getting passed in through a function. The
name of the subform is BinderSub and it gets passed to the function in a
string called FormName.
When I try and start my For loop for the audit trail, like so:
For Each C In Forms(FormName).Controls
It errors on this as it says it can't find the form BinderSub referred in a
macro expression or VB Code.
Can anyone help me reference this properly without actually putting the name
of the form!subformname because I need this to work with all my databases and
all my forms and I don't want to change the code in the module for the audit
trail.
Thanks in advance!
I need to reference my subform in a module I have that is creating an audit
trail. The name of the subform is getting passed in through a function. The
name of the subform is BinderSub and it gets passed to the function in a
string called FormName.
When I try and start my For loop for the audit trail, like so:
For Each C In Forms(FormName).Controls
It errors on this as it says it can't find the form BinderSub referred in a
macro expression or VB Code.
Can anyone help me reference this properly without actually putting the name
of the form!subformname because I need this to work with all my databases and
all my forms and I don't want to change the code in the module for the audit
trail.
Thanks in advance!