Trying to save is deleting and replacing records !
Hi,
I am trying to save records from a dataform to database table, but the problem I am having is each time I try to save the the 1st record on the database table is deleted and replaced with a new record! But I do want to keep every record. My code is as follows:
Private Sub CheckBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.Click
If CheckBox1.Checked Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
DateTimePicker.Refresh()
TextBox1.Focus()
Else
TextBox1.Focus()
End If
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.PCT_BindingSource.EndEdit()
Me.PCT_TableAdapter.Update(Me.HATDataSet.PCT)
MsgBox("Record has been updated!", MsgBoxStyle.OkOnly)
CheckBox1.Checked = False
End Sub
What I am doing wrong? How can I correct it? Thanks.
|