I have a database with a form that is linked to one table and a subform linked to another table. In the subform there is a field called "DeleteRecord" and is a checkbox. What i am trying to do is create a delete button that deletes all the records in the proper table that have the field checks. I have tried finding the problem in the code but cant seem to find it. The way it is supposed to work is it looks at if the "DeleteRecord" box is checked, and if it is, then it looks to make sure the Owner for the record matches the current user, who logins in w/ his owner name. If they are equal, all checked records for that owner are deleted.
Any ideas?
Private Sub Command22_Click()
Set rst = CurrentDb.OpenRecordset("ResourceAllocation")
Do Until rst.EOF
If ResourceAllocation.[DeleteRecord] = True And ResourceAllocation.[Owner] = Owners.[Owner Name] Then
DoCmd.RunMacro "delete"
End If
rst.MoveNext
Loop
End Sub