Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add subform (like in Access) in Visual Basic?

Status
Not open for further replies.

gundie

Programmer
Feb 5, 2004
69
0
0
US
I have a main form, and I want to embed a subform (similar to Access) into this main form. I want to display the corresponding subform base on a combo box selection on the main form. How can I do that?
 
Depends on if you want to use Form1 as the MDI Parent or not.

If not, like this:

Dim F as New Form2
F.Show

If so, like this:

Dim F as New Form2
F.MdiParent = Me ''or whatever MDI is your Parent Form
F.Show()

I hope this helps

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
There are no subforms in vb.net(except third party) you can use DataGridView, DataGrid or ListView for that purpose.
Little complicated...



Google for "Master detail vb.net".. plenty of examples.

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
You can add a panel to your form. Then in code create the form, making sure to set TopLevel = False, then just add it to the form. If you are going to be working back and forth, then you need to create the form as a globabl variable.

If [blue]you have problems[/blue], I want [green]source code[/green] AND [green]error messages[/green], none of this [red]"there was an error crap"[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top