Easy Question, I hope. refrencing forms
I know in VBA that you can refrence a form like so:
public sub test()
....Dim frm as Form
....Dim ctl as Control
....set frm = forms("frmParent")
....for each ctl in frm.Controls
........msgbox(ctl.Name)
....next ctl
end sub
My question, is how do I set the frm object to a subform of a form? if frmParent had a subform object on it called frmChild, how could I set the frm object to that form?
The overall problem is that I am having problems with Access XP with objects that have recordsources with refrences to controls on the form. When the form closes, I get parameter value errors. My solution to this was to set all of the recordsource properties on the form to "" on the close event.
This seems to work, however if there is a subform with said situation, I can't fix it, and I would like to make a catchall sub that can handle any form. If I can figure out how to refrence the subforms, then I can make a nice little recursive function to handle any form.
Thanks for any assistance!
-Jim
I know in VBA that you can refrence a form like so:
public sub test()
....Dim frm as Form
....Dim ctl as Control
....set frm = forms("frmParent")
....for each ctl in frm.Controls
........msgbox(ctl.Name)
....next ctl
end sub
My question, is how do I set the frm object to a subform of a form? if frmParent had a subform object on it called frmChild, how could I set the frm object to that form?
The overall problem is that I am having problems with Access XP with objects that have recordsources with refrences to controls on the form. When the form closes, I get parameter value errors. My solution to this was to set all of the recordsource properties on the form to "" on the close event.
This seems to work, however if there is a subform with said situation, I can't fix it, and I would like to make a catchall sub that can handle any form. If I can figure out how to refrence the subforms, then I can make a nice little recursive function to handle any form.
Thanks for any assistance!
-Jim