Good afternoon,

I am a little lost here. Perhaps I am missing something. What I am trying to do is some test code were I have one user form, a text box and a button. I am trying to put the data in the textbox into an Access file by a click of the button. But nothing happens.

    Public Class Form1
    Dim MaxRows As Integer
    Dim inc As Integer
    Dim con As New OleDb.OleDbConnection
    Dim dbProvider As String
    Dim dbSource As String
    Dim ds As New DataSet
    Dim da As OleDb.OleDbDataAdapter
    Dim sql As String

    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        If inc <> -1 Then

            Dim cb As New OleDb.OleDbCommandBuilder(da)
            Dim dsNewRow As DataRow

            dsNewRow = ds.Tables("NPS").NewRow()

            dsNewRow.Item("DOD") = TextBox1.Text


            da.Update(ds, "NPS")

            MsgBox("New Record added to the Database")
        End If


    End Sub

    Private Sub NewBRMAuto_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


        dbProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0;"
        dbSource = "Data Source = C:\Test\NPS.mdb"

        con.ConnectionString = dbProvider & dbSource


        sql = "SELECT * FROM tblContacts"
        da = New OleDb.OleDbDataAdapter(sql, con)
        da.Fill(ds, "NPS")


        MaxRows = ds.Tables("NPS").Rows.Count
        inc = -1

    End Sub
End Class