I have buttons working that cycles through all the records and everything shows up fine. I also made a simple DB program to test what I was doing without all the extra stuff my current program has and it works fine. Updates the dataset and then saves to the database and reflects the changes. When I tried adding it to this program, I get errors when I click "Save" and "Commit".

The "Save" (updates DS) error is: "Additional information: Update requires a valid UpdateCommand when passed DataRow collection with modified rows."

The "Commit" (commits changes to DB) error is: "Additional information: Syntax error in INSERT INTO statement."

Not sure what either of these mean, the same code worked fine in the standalone program. Looking at another site, they show the exact Save error I'm getting and say it's because I don't have a command builder, but it's up there. Here is all relevant code to the DB stuff:

vb Code:
  1. '''Testing DB functionality
  2.     Dim inc As Integer
  3.     Dim MaxRows As Integer
  4.  
  5.     Dim con As New OleDb.OleDbConnection
  6.     Dim ds As New DataSet
  7.     Dim data As OleDb.OleDbDataAdapter
  8.     Dim sql As String
  9.  
  10.      con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\work\EyeBase.mdb"
  11.         con.Open()
  12.  
  13.  
  14.         sql = "SELECT * FROM History"
  15.         data = New OleDb.OleDbDataAdapter(sql, con)
  16.         data.Fill(ds, "History")
  17.  
  18.         con.Close()
  19.  
  20.  
  21.         MaxRows = ds.Tables("History").Rows.Count
  22.         inc = -1
  23.  
  24. Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
  25.         If inc <> MaxRows - 1 Then
  26.             inc = inc + 1
  27.             NavigateRecords()
  28.         Else
  29.             MsgBox("No More Rows")
  30.         End If
  31.     End Sub
  32.  
  33.     Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
  34.         If inc <> MaxRows - 1 Then
  35.             inc = MaxRows - 1
  36.             NavigateRecords()
  37.         End If
  38.     End Sub
  39.  
  40.     Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
  41.         If inc <> 0 Then
  42.             inc = 0
  43.             NavigateRecords()
  44.         End If
  45.     End Sub
  46.  
  47.     Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
  48.         If inc > 0 Then
  49.             inc = inc - 1
  50.             NavigateRecords()
  51.         ElseIf inc = -1 Then
  52.             MsgBox("No Records Yet")
  53.         ElseIf inc = 0 Then
  54.             MsgBox("First Record")
  55.         End If
  56.     End Sub
  57.  
  58.  
  59.     Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
  60.         If inc = -1 Then
  61.             MsgBox("Can't update yet")
  62.         Else
  63.  
  64.  
  65.             ds.Tables("History").Rows(inc).Item(3) = Chief_ComplaintTextBox.Text
  66.             'ds.Tables("AddressBook").Rows(inc).Item(2) = txtLast.Text
  67.             'ds.Tables("AddressBook").Rows(inc).Item(3) = txtAddress1.Text
  68.             'ds.Tables("AddressBook").Rows(inc).Item(4) = txtAddress2.Text
  69.             'ds.Tables("AddressBook").Rows(inc).Item(5) = txtAddress3.Text
  70.             'ds.Tables("AddressBook").Rows(inc).Item(6) = txtZIP.Text
  71.             'ds.Tables("AddressBook").Rows(inc).Item(7) = txtPhone.Text
  72.             'ds.Tables("AddressBook").Rows(inc).Item(8) = txtEmail.Text
  73.             'ds.Tables("AddressBook").Rows(inc).Item(9) = txtNotes.Text
  74.  
  75.             data.Update(ds, "History")
  76.  
  77.             MsgBox("Data updated")
  78.         End If
  79.     End Sub
  80.  
  81.     Private Sub btnCommit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCommit.Click
  82.         If inc <> -1 Then
  83.  
  84.             Dim cb As New OleDb.OleDbCommandBuilder(data)
  85.             Dim dsNewRow As DataRow
  86.  
  87.             dsNewRow = ds.Tables("History").NewRow()
  88.  
  89.             dsNewRow.Item("Chief Complaint") = Chief_ComplaintTextBox.Text
  90.             'dsNewRow.Item("Surname") = txtLast.Text
  91.             'dsNewRow.Item("Address1") = txtAddress1.Text
  92.             'dsNewRow.Item("Address2") = txtAddress2.Text
  93.             'dsNewRow.Item("Address3") = txtAddress3.Text
  94.             'dsNewRow.Item("Postcode") = txtZIP.Text
  95.             'dsNewRow.Item("Phone") = txtPhone.Text
  96.             'dsNewRow.Item("Email") = txtEmail.Text
  97.             'dsNewRow.Item("Notes") = txtNotes.Text
  98.  
  99.             ds.Tables("History").Rows.Add(dsNewRow)
  100.  
  101.             data.Update(ds, "History")
  102.  
  103.             MsgBox("New Record added to the Database")
  104.         End If
  105.     End Sub