T
TraciAnn via AccessMonster.com
Working with forms, I constantly find it difficult to "locate" an object
using vba. Can someone help me understanding the "path" to certain objects?
For example:
A Main Form (frmMain) with a Tabbed control (tabControl) with Subforms
(frmSub1, frmSub2, etc.) on each tab.
When I am in a control (txtControl1) on frmSub1 and I want to reference a
value in a control (txtControl2) on frmSub2, I try typing a variety of
"paths" in my code editor but I can't find the right combination. I have
tried using page control names (pgeControl1, pgeControl2, etc.) also but it
still doesn't work.
Logically it seems that it should be:
Me.Parent.tabControl.pgeControl2.frmSub2.txtControl2
OR
Forms.frmMain.tabControl.pgeControl2.frmSub2.txtControl2
Please help me understand this! Thanks!
using vba. Can someone help me understanding the "path" to certain objects?
For example:
A Main Form (frmMain) with a Tabbed control (tabControl) with Subforms
(frmSub1, frmSub2, etc.) on each tab.
When I am in a control (txtControl1) on frmSub1 and I want to reference a
value in a control (txtControl2) on frmSub2, I try typing a variety of
"paths" in my code editor but I can't find the right combination. I have
tried using page control names (pgeControl1, pgeControl2, etc.) also but it
still doesn't work.
Logically it seems that it should be:
Me.Parent.tabControl.pgeControl2.frmSub2.txtControl2
OR
Forms.frmMain.tabControl.pgeControl2.frmSub2.txtControl2
Please help me understand this! Thanks!