Hi Folks,
I am looking at using a TabControl to display records from a database. The basic gist is that I pull a selection of records out of a database and add a tabpage to the tabcontrol for each one (code shown below). One field is used for the tabpage.text and the other is to be displayed in a text box on the new tab page.
My problem is that the database record text is assigned to the text box, but when I tab around, the text is not seen. If I create a text box at design time for a tabpage, it is seen when I click on a tab.
Any ideas?!
Thanks in advance
Paul
Dim tpDetails As New TabPage
Dim txtTab As New TextBox
For Each rowDets In dsCardFile.Tables("Details").Rows
If Not IsDBNull(rowDets("Notes")) Then
txtTab.Text = rowDets("Notes")
End If
tpDetails.Controls.Add(txtTab)
tpDetails.Text = rowDets("Name")
tpDetails.Name = rowDets("Name")
FrmCardFile.tbDetails.TabPages.Add(tpDetails)
Next
I am looking at using a TabControl to display records from a database. The basic gist is that I pull a selection of records out of a database and add a tabpage to the tabcontrol for each one (code shown below). One field is used for the tabpage.text and the other is to be displayed in a text box on the new tab page.
My problem is that the database record text is assigned to the text box, but when I tab around, the text is not seen. If I create a text box at design time for a tabpage, it is seen when I click on a tab.
Any ideas?!
Thanks in advance
Paul
Dim tpDetails As New TabPage
Dim txtTab As New TextBox
For Each rowDets In dsCardFile.Tables("Details").Rows
If Not IsDBNull(rowDets("Notes")) Then
txtTab.Text = rowDets("Notes")
End If
tpDetails.Controls.Add(txtTab)
tpDetails.Text = rowDets("Name")
tpDetails.Name = rowDets("Name")
FrmCardFile.tbDetails.TabPages.Add(tpDetails)
Next