G
Guest
I'm using VB .Net 2005 with Access 2003 for the database. The database has
two tables: tblContact (ContactNum (k), lastname, firstname, phone, email,
compNum) and tblCompany (CompNun (k), CompName, address, city, state, zip,
compNum)
There are a unumber of contact at each company. I have created a Windows
form where I can select a contact, all of the information about the contact
(tblContact), and the information about the (tblCompany) appears and can be
edited.
If I try to add a new contact, at a new company; the contact information is
saved to tblContact, but the company is not saved. Edit can be made to any
field for either table, but new records cannot be added to the company table.
The code is:
Private Sub TblContactBindingNavigatorSaveItem_Click(ByVal sender _
As System.Object, ByVal e As System.EventArgs) _
Handles TblContactsBindingNavigatorSaveItem.Click
'save, update records
Me.Validate()
Me.TblCompanyBindingSource.EndEdit()
Me.TblCompanyTableAdapter.Update(Me.DsContactData.tblCoAddress)
Me.TblContactBindingSource.EndEdit()
Me.TblContactTableAdapter.Update(Me.DsContactData.tblContact)
End Sub
When I run the program no errors appear, but nothing is saved to the
tblCompany table. Any help will be appreciated.
two tables: tblContact (ContactNum (k), lastname, firstname, phone, email,
compNum) and tblCompany (CompNun (k), CompName, address, city, state, zip,
compNum)
There are a unumber of contact at each company. I have created a Windows
form where I can select a contact, all of the information about the contact
(tblContact), and the information about the (tblCompany) appears and can be
edited.
If I try to add a new contact, at a new company; the contact information is
saved to tblContact, but the company is not saved. Edit can be made to any
field for either table, but new records cannot be added to the company table.
The code is:
Private Sub TblContactBindingNavigatorSaveItem_Click(ByVal sender _
As System.Object, ByVal e As System.EventArgs) _
Handles TblContactsBindingNavigatorSaveItem.Click
'save, update records
Me.Validate()
Me.TblCompanyBindingSource.EndEdit()
Me.TblCompanyTableAdapter.Update(Me.DsContactData.tblCoAddress)
Me.TblContactBindingSource.EndEdit()
Me.TblContactTableAdapter.Update(Me.DsContactData.tblContact)
End Sub
When I run the program no errors appear, but nothing is saved to the
tblCompany table. Any help will be appreciated.