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!

Use tabs for successive records 1

Status
Not open for further replies.

Saturn57

Programmer
Aug 30, 2007
275
0
0
CA
I have two related tables one is a header table and one is a detail table. I would like a tab for the header table data input and then I would like to be able to create a new tab for each detail record that is associated with the header record. I cannot seem to figure out how to do this. Can anyone help me on this.
 
the tabpages are added to the tabcontrol - in simplistic form (attaching the code from a button for demonstration purposes with an existing tabcontrol on a form)
Code:
    Private tabPageNew As TabPage

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click

        Me.tabPageNew = New TabPage()
        tabPageNew.Text = "Created"

        TabControl1.TabPages.Add(tabPageNew)

    End Sub

Need then to add the various labels textboxes etc to the tabpage & populate them
Is that what you wanted?
 
Thanks Huggyboy. This creates a new tab but it does not say to create a new record how can this be accomplished.
 
Make the new tab data bound. Then move the Current position of the data source to the selected Details record.

You will have to dynamically place the controls on the new tab. I believe it should be possible for you to create it once, manually in the designer, then save the designer code and reuse it each time you need to add a tab.

I actually have an application with many tabs with the same controls. The way I do it is place the controls on the first tab in design, then re-bind and move them (change Parent) to the tab selected by the user...
 
Thanks BugSlayer can you give me some examples of how to move the current position of the data source of the details record as im very green at this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top