I have this code below that I hoped would find the record based on the coursebk id number of the current record in the subform, then seek it in the bookings table and delete it.
It doesnt work it returns error 3251 operation not supported for that type of object.
Help.......
regards
Dim db As DAO.Database
Set db = CurrentDb
Dim RstFtran As DAO.Recordset
Dim RstCourseBk As DAO.Recordset
Dim CourseBkID As String
Set RstCourseBk = db.OpenRecordset("Coursebk")
CourseBkID = Me!CourseBkID
With RstCourseBk
'**************** fails on line below.
.Seek "=", Val(CourseBkID)
If .NoMatch Then
MsgBox "No employee #" & CourseBkID & " in file!"
Else
.Delete
MsgBox "Record #" & CourseBkID & _
" deleted!"
End If
End With
It doesnt work it returns error 3251 operation not supported for that type of object.
Help.......
regards
Dim db As DAO.Database
Set db = CurrentDb
Dim RstFtran As DAO.Recordset
Dim RstCourseBk As DAO.Recordset
Dim CourseBkID As String
Set RstCourseBk = db.OpenRecordset("Coursebk")
CourseBkID = Me!CourseBkID
With RstCourseBk
'**************** fails on line below.
.Seek "=", Val(CourseBkID)
If .NoMatch Then
MsgBox "No employee #" & CourseBkID & " in file!"
Else
.Delete
MsgBox "Record #" & CourseBkID & _
" deleted!"
End If
End With