Hi All,

This is the code i am using to load data from an access database and the code used to update the database:

vb Code:
  1. Public custDA As OleDb.OleDbDataAdapter
  2. Public CustDS As New DataSet
  3.  
  4.     Private Sub frmCustomersContainer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  5.  
  6.         custDA = New OleDb.OleDbDataAdapter("SELECT * FROM Customers ORDER By Customers.customer ASC", con)
  7.         custDA.Fill(CustDS)
  8.  
  9.         Dim custTbl As DataTable = CustDS.Tables(0)
  10.  
  11.         Me.dgvCustomers.DataSource = custTbl
  12.         Me.dgvCustomers.Columns(0).Visible = False
  13.         Me.dgvCustomers.Columns(1).Width = Me.dgvCustomers.Width - 15
  14.  
  15.     End Sub

vb Code:
  1. Private Sub frmCustDetailsDetails_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.  
  3.         Dim tbl As DataTable = frmCustomersContainer.CustDS.Tables(0)
  4.  
  5.         txtAddress.DataBindings.Add("Text", tbl, "Address")
  6.         txtPostcode.DataBindings.Add("Text", tbl, "PostCode")
  7.  
  8. End Sub
  9.  
  10. Private Sub frmCustDetailsDetails_Leave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Leave
  11.  
  12.         If frmCustomersContainer.CustDS.HasChanges Then
  13.             frmCustomersContainer.CustDS.AcceptChanges()
  14.             frmCustomersContainer.custDA.Update(frmCustomersContainer.CustDS.Tables(0))
  15.         End If
  16.  
  17. End Sub

When i change either txtaddress or txtpostcode the dataset is updated but not the database.

What am i missing?

TIA

Rico