Having used Access quite a bit, I think I know what you are asking, and the answer is, "There isn't one". You cannot insert an already created form as a control on another form. However, you can use a PictureBox control as a container for other controls, in effect making it a sub-form. You can have several Picture boxes, each with their own set of controls, and hide and unhide them dynamically, allowing you to, in effect, display several different "sub-forms" in the same area, based on run-time logic.
Also look into using the Tab control, which allows you to create sets of controls on each tab, and then switch which tab is visible at any moment, just as you would do manually with multiple Picture Boxes.
But it really depends on what you are wanting to do. If you just want to display a grid of data, use a DataGrid control and a Data control to bind to.
If this doesn't help, let us know what it is you want to accomplish, and we can give you some ideas on how to accomplish it.
Everything is hard-coded with VB. LlomaxX's suggestion is sufficient. But, if you would want to use a simulated "subform" on more than one instance, better revert to the UserControl.
Subform in VB implies using the DataRepeater control but the DataRepeater control can only display a control contained in an OCX (custom-designed in another project via UserControls). So if you have a fairly complex app with multiple types of subforms, you have to create an OCX with multiple UserControls to handle all the subforms and ensure that that OCX registers itself. If you have to alter your subforms, you have to recompile the OCX and have the user re-register it. I think the DataRepeater, if my assumptions are correct, is a poor solution to a common VB problem.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.