bustercrabb
Instructor
Hello:
I cannot update a record in my table in Access using a custom form, and I believe that it is because I have the table indexed. It is indexed because I don't want duplicates and I need it to do random searches.
The error that I get is common: "...would not update because it would create a duplicate record..." I am lost, and cannot figure out another option. Here is my code, and thanks in advance for your time:
Set Database2 = CurrentDb()
Set rs2 = Database2.OpenRecordset("SELECT f2,f1, f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f14,f16,f17,f18,f19,f20,f21,f22 FROM 2016_Graded ORDER BY f2 ASC;")
rs2.MoveFirst
With rs2
.Edit
rs2![f11] = ef_ID
rs2![f2] = ef_tname
rs2![f3] = ef_dob
rs2![f18] = ef_Date
rs2![f9] = ef_ethnicity
rs2![f10] = ef_gender
rs2![f12] = ef_comments
rs2.Update
End With
I cannot update a record in my table in Access using a custom form, and I believe that it is because I have the table indexed. It is indexed because I don't want duplicates and I need it to do random searches.
The error that I get is common: "...would not update because it would create a duplicate record..." I am lost, and cannot figure out another option. Here is my code, and thanks in advance for your time:
Set Database2 = CurrentDb()
Set rs2 = Database2.OpenRecordset("SELECT f2,f1, f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f14,f16,f17,f18,f19,f20,f21,f22 FROM 2016_Graded ORDER BY f2 ASC;")
rs2.MoveFirst
With rs2
.Edit
rs2![f11] = ef_ID
rs2![f2] = ef_tname
rs2![f3] = ef_dob
rs2![f18] = ef_Date
rs2![f9] = ef_ethnicity
rs2![f10] = ef_gender
rs2![f12] = ef_comments
rs2.Update
End With