S
Stuart Grant
I have a very simple Personnel Record Database. The main form has a
2-column ListBox, named NamesList, with LastName,FirstName with the Bound
column LastName. Then there are text boxes which give all the other details
in the main table - address etc.. You select the record by clicking
LastName in the list box and the details appear.
It used to work but now after editing an entry, when I try to move to
another record I get the error message "Cannot update etc because duplicate
in the index or primary key or relationship. None of which makes sense. The
Primary key is autonumber, the only field indexed is LastName and it has
duplicates allowed and anyway I did not change the last name.
The code to find the record set is
Private Sub NamesList_Click()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[LastName] = '" & Me.NamesList & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
It now chokes on Me.Bookmark = rs.Bookmark.
What has gone wrong ?
Stuart
2-column ListBox, named NamesList, with LastName,FirstName with the Bound
column LastName. Then there are text boxes which give all the other details
in the main table - address etc.. You select the record by clicking
LastName in the list box and the details appear.
It used to work but now after editing an entry, when I try to move to
another record I get the error message "Cannot update etc because duplicate
in the index or primary key or relationship. None of which makes sense. The
Primary key is autonumber, the only field indexed is LastName and it has
duplicates allowed and anyway I did not change the last name.
The code to find the record set is
Private Sub NamesList_Click()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.RecordsetClone
rs.FindFirst "[LastName] = '" & Me.NamesList & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
It now chokes on Me.Bookmark = rs.Bookmark.
What has gone wrong ?
Stuart