开发者

MS Access = referencing a control that is within a sub form

So I have a form, with a subform control that acts as a navigation scheme for my Main Form. Within the sub form, there is a sub form2 that actually contains the controls for data entry.

So the Main Form is almost just like a design shell around the sub2 within sub1 structure. So in subform1 there is 10 clickable buttons that open 10 different forms in the subform2 window. The subform2 contains the controls.....so here is my issue/question:

So if I have a click event on the subform2 where i am trying to open the next form (subform2 form) within the subform1 child control, which is within the Main Form, what is the vb syntax for handling this?

I am not sure if i am asking this correctly.

I tried:

Forms!SubForm1.MyChild.sourceobject = "NextSubForm2"

but this only works if the Main Form开发者_如何学JAVA is not open....like if I only had the SubForm1 open.

One more thing, this is code behind the form of the SubForm2 (2 being the sub within the sub within the form).


The main form from a subform's point of view is:

Me.Parent

You can build on this:

Me.Parent.Subform1ControlName.Form.AControl

See also: http://www.mvps.org/access/forms/frm0031.htm

So:

Me.Parent.Subform1ControlName.SourceObject = "SomeForm"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜