Tab control and table relationships

E

EManning

I'm a newbie to VB.Net so I hope I'm using the right terminology. I'm in the
process of converting a faculty database from Access to VB.Net (2005). I
have one table for general information and many tables related to it by a
one-to-many relationship on an ID field. Looking at the dataset's xsd for my
VB.Net project, I noticed that the relationships appear to follow the mdb
when I connected the mdb to the project.

Now the problem. I have a tab control on my form and on the first page, I
have fields from the general information table (one record displayed at a
time). On the next page, I have fields from one of the other tables, and so
on. I expected the data on the 2nd, 3rd , 4th... pages to be related to the
data on the first page, but it is not. So apparently the relationship is not
"following" the controls on the tab control.

Below is a sample of the code that was generated when I placed the fields on
the control:

Me.TblEducationTableAdapter.Fill(Me.FacultyDataSet.tblEducation
Me.TblGeneralInformationTableAdapter.Fill(Me.FacultyDataSet.tblGeneralInformation)

(tblGeneralInformation has a one-to-many relationship with tblEducation
based on the field "ID")

Do I need to modify the code for tblEducation to select data based on the ID
for tblGeneralInformation? Something like this:

strSQL = SELECT * FROM tblEducation WHERE ID = <tblGeneralInformation's ID>
Me.TblEducationTableAdapter.Fill(strSQL)

Or is there something else I need to do to get this relationship to "work".

Thanks for any help or advice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top