I have the following code to edit an existing record.
When i try to run it, i get message saying that i cannot create duplicate entries. I want to edit not crate a new entry.. How can i fix it?
Code:
If DCount("ID", "AssignLoc", "[ID] = '" & Me.ID & "'") > 0 Then
Set db = CurrentDb
Set rs = db.OpenRecordset("AssignLoc")
rs.Edit
rs("ID") = Me.ID
rs("AssignLoc") = Me.AssignLoc
'rs("OWC") = Me.OWC
rs("LastUpdate") = Format(Date, "dd-mmm-yy")
rs.Update
rs.Close
Comment