I am not sufficiently fluent in vba so I flop around, experimenting with naming conventions to get references to controls correct. I eventually get it right, but this consumes a lot of time. It would be nice to have a function that would return the proper reference for me.
Plus, I've noticed that the syntax for referencing a control explicitly is not the same as setting a variable for the form then referring to the form!control. An example:
I have a form frmMomsBabies, with a subform control ctlSubbabies. The fully qualified identifier for the control txtBaby on the subform is forms!frmMomsBabies!ctlSubbabies.form!txtBaby. However, if I dimension frmBaby as a subform, it must be set = forms!frmMomsBabies!ctlSubbabies so that I can reference frmBaby!txtBaby. The difference is that ".form" does not appear in the set statement.
I'm flummoxed now trying to set a variable for a nested subform. And all of the usual suspects don't seem to work. So I'm hoping someone else has solved this problem and can point me in the right direction. Is there a function that will report the fully qualified name of any reference?
Thanks for reading.
George
Plus, I've noticed that the syntax for referencing a control explicitly is not the same as setting a variable for the form then referring to the form!control. An example:
I have a form frmMomsBabies, with a subform control ctlSubbabies. The fully qualified identifier for the control txtBaby on the subform is forms!frmMomsBabies!ctlSubbabies.form!txtBaby. However, if I dimension frmBaby as a subform, it must be set = forms!frmMomsBabies!ctlSubbabies so that I can reference frmBaby!txtBaby. The difference is that ".form" does not appear in the set statement.
I'm flummoxed now trying to set a variable for a nested subform. And all of the usual suspects don't seem to work. So I'm hoping someone else has solved this problem and can point me in the right direction. Is there a function that will report the fully qualified name of any reference?
Thanks for reading.
George
Last edited: