I dont know how i Can fixed the wrong in my program...the problem is con.open()
Private Sub btnadd1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnadd1.Click Dim cmd As New OleDb.OleDbCommand Dim con As New OleDb.OleDbConnection Dim Printlist1 As New DataTable If Not con.State = ConnectionState.Open Then con.Open() cmd.Connection = con End If If Me.text1.Tag & "" = "" Then cmd.CommandText = "INSERT INTO Datagrid1(StickerCode, Description, Company, Department, Location, User, SerialNumber, DatePurchased, Tagable, Quantity, Brand, Model ) " & _ " VALUES(" & Me.text1.Text & ",'" & Me.text2.Text & "','" & _ Me.text3.Text & "','" & Me.text4.Text & "','" & Me.text5.Text & "','" & _ Me.text6.Text & "','" & Me.text7.Text & "','" & Me.text8.Text & "','" & _ Me.text9.Text & "','" & Me.text10.Text & "','" & Me.text11.Text & "','" & _ Me.text12.Text & "')" cmd = New OleDbCommand(cmd.CommandText, con) cmd.ExecuteNonQuery() Else cmd.CommandText = "UPDATE Form4 " & _ " SET StickerCode='" & Me.text1.Text & _ ", Description='" & Me.text2.Text & "'" & _ ", Company='" & Me.text3.Text & "'" & _ ", Department='" & Me.text4.Text & "'" & _ ", Location='" & Me.text5.Text & "'" & _ ", User='" & Me.text6.Text & "'" & _ ", SerialNumber='" & Me.text7.Text & "'" & _ ", DatePurchased='" & Me.text8.Text & "'" & _ ", Tagable='" & Me.text9.Text & "'" & _ ", Quantity='" & Me.text10.Text & "'" & _ ", Brand='" & Me.text11.Text & "'" & _ ", Model='" & Me.text12.Text & "'" & _ " WHERE text1=" & Me.text1.Tag cmd.ExecuteNonQuery() End If RefreshData() Me.btnclear1.PerformClick() con.Close() End Sub