Quote:> I don't understand what the !ObjectID = -5 is all about but I think I
That just happens to be another field in the record.
> know your problem. I am willing to bet that the underlying table has an
> identity column. When you add a new row thru ADO with the AddNew method it
RS.
> So when you try and issue an update on a newly inserted record it doesn't
> know the PK to use to find the proper row.
Yes, it has an identity column called ID (which autoincrements). I think
you're right, it is something to do with this field. It's the second .Update
that fails. My take on this is that after the UPDATE on a newly added
record, ADO doesn't know where the record was actually added to the table.
In fact, you can fix it by doing this:
DB.rsOpenObjects.Open
With DB.rsOpenObjects
.AddNew
.Update
TempBookmark = .Bookmark
.Bookmark = TempBookmark
!ObjectID = -5
.Update
End With
Cheers, Rob.