Dear Loungers,
I have tried (I think) every combination of locktypes and cursortypes, but still Access will not allow me to delete records. It should be so simple. I’m going against a plain vanilla jet data database.
Sub test()
Dim rstPurchaseDetail As ADODB.Recordset
Dim strsql As String
strsql = “SELECT tblPurchaseHeader.*, tblPurchaseDetail.* ”
strsql = strsql & “FROM tblPurchaseHeader INNER JOIN tblPurchaseDetail ON ”
strsql = strsql & “tblPurchaseHeader.PurchaseID = tblPurchaseDetail.PurchaseID ”
Set rstPurchaseDetail = New ADODB.Recordset
rstPurchaseDetail.Open Source:=strsql, ActiveConnection:=CurrentProject.Connection, _
CursorType:=adOpenKeyset, LockType:=adLockOptimistic
rstPurchaseDetail.Delete adAffectAll
End Sub
Hope you can help,
Gwenda