I would like to run some code where the reference is to a sub form on another form. The path would be:
And I used as a Dim statement:
Then when I want to reference the control on the subform I tried
But nothing happens. If I use the full file path
All is OK. But since I have about a half dozen controls to populate, the code looks cumbersome.
Is there a way to Dim the file path and then combine it with the control name?
Thanks.
Code:
Forms![FrmMain]![frmSalesContactsSub].Form!And I used as a Dim statement:
Code:
Dim sform as string
sform = "Forms![FrmMain]![frmSalesContactsSub].Form!"Then when I want to reference the control on the subform I tried
Code:
ControlA = sform & ControlABut nothing happens. If I use the full file path
Code:
ControlA = Forms![FrmMain]![frmSalesContactsSub].Form!ControlAAll is OK. But since I have about a half dozen controls to populate, the code looks cumbersome.
Is there a way to Dim the file path and then combine it with the control name?
Thanks.
Dim Statment question
0 commentaires:
Enregistrer un commentaire