I have a form "Client Order" which displays records of "Order Item" in a subform. I need a macro for a button on the Client Order form that deletes Order Item records in that subform when clicked. Access provides DeleteRecord which will delete the record in the form, not the subform records. I only want the subrecords to be deleted, how do I do this?
I have tried using the function:
Function DeletePOSub()
Me.frmSub.Form.Recordset.Delete
Me.frmSub.Form.Recordset.MoveNext
End Function
From the source http://www.access-programmers.co.uk/forums/showthread.php?t=74987
However, this gives me the error "Invalid use of Me keyword" when run.