am trying to delete records from two tables at once. They are not using the same Primary key.
Does that make a difference ? STUDENTCODE and STUDENTNUMBER are the primary key
Would it help to set a relationship ?
How can a update my UserInterface after the Delete?
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim cmd As New OleDbCommand("DELETE FROM [STUDENT] " & _
"WHERE [STUDENTCODE] = '" & MaskedTextBox1.Text & "'", con)
dt = New DataTable
Dim CMD2 As New OleDbCommand("DELETE FROM [TESTS] " & _
"WHERE [STUDENTNUMBER] = '" & MaskedTextBox2.Text & "'", con)
Me.BindingContext(stu.dt).EndCurrentEdit() ' Student table
Me.BindingContext(bk.dt).EndCurrentEdit() ' Tests table