I have two forms in a tab control in Microsoft Access. One 开发者_开发问答of the forms contains a variable that I need to share between other forms in the tab control.
This link: http://www.codeproject.com/KB/vb/passvaluetoaccessform.aspx
Shows me how to pass a variable between forms, when I open the other form. I need to be able to pass a variable to a form that is already open within a subForm in a tab control.
Any ideas?
Why pass a variable? The forms can see other, as long as you use the right syntax.
If the subforms are Subform1 and Subform2 on the same parent form, from Subform1, you can look at any properties of Subform2 from Subform1 with this:
Me.Parent!Subform2.Form!ControlName
Likewise, from Subform2, you can get to properties/controls of Subform1 with:
Me.Parent!Subform1.Form!ControlName
So, there's no need for variables. Anything you calculate in code you can assign directly to the property/control in the other form as needed.
精彩评论