Bookmark.Lastmodified

L

Leanne

I try to get new record's id, first time works. But try again will only show
first try id. I use Access links a Oracle table. Code as:
With rs
.AddNew
!CREATEDATE = Now
.Update
If .Bookmarkable = True Then .Bookmark = .LastModified
.Requery
MsgBox !ID
End With
Set rs = Nothing

Need help. Thanks
Leanne
 
S

Sylvain Lafontaine

You don't need the .Requery (each time you call it, the recordset's position
is reset at the beginning) and you can get the new ID before the update for
many types of recordsets (but not for all). However, as we don't see here
how you have opened the RS, it's hard to say more on this.
 
L

Leanne

Thank you very much for your response. I use DAO openrecordset to open
Oracle link table RS. If I don't use .Requery, there will be an error
"Record is deleted".
 
L

Leanne

Thank you very much. I figure it out. It is Oracle Linke table problem. So
I use SQL to add new record, then select max ID.

Leanne
 
S

Sylvain Lafontaine

I'm not sure if the use of Max(ID) is a good thing in a multi-user
environment. You should ask your question to an Oracle newsgroup (see the
hierarchy « comp.databases.oracle.* » ).
 
Top