Hi all,
I need to be able to reference a form in VBA. The form may be different depending on user selections. I want to be able to set a variable to reference the appropriate form.
The code is in a module, the form name being passed in as an attribute, stFrm.
I can use
DoCmd.OpenForm stFrm
to open the form, but how do I set, say, a variable frm to reference that opened form?
I need to be able to manipulate various parts of the form design as below:
frm.RecordSource = stFormSQL
frm.Area.Visible = False
and also change some information later as below:
frm!lvMan = inLevelManager
I can achieve all this by using
Forms!frmCumCharts......
instead of using the frm variable, but just can not set the variable.
Anybody point me in the right direction?
Aidan Hughes
I need to be able to reference a form in VBA. The form may be different depending on user selections. I want to be able to set a variable to reference the appropriate form.
The code is in a module, the form name being passed in as an attribute, stFrm.
I can use
DoCmd.OpenForm stFrm
to open the form, but how do I set, say, a variable frm to reference that opened form?
I need to be able to manipulate various parts of the form design as below:
frm.RecordSource = stFormSQL
frm.Area.Visible = False
and also change some information later as below:
frm!lvMan = inLevelManager
I can achieve all this by using
Forms!frmCumCharts......
instead of using the frm variable, but just can not set the variable.
Anybody point me in the right direction?
Aidan Hughes