469,593 Members | 2,099 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,593 developers. It's quick & easy.

Cloning a record

I have some code that uses the recordset command to duplicate an
existing record within the same table. After updating this new record
I want the user to be able to edit it, but the bookmark lastedited
command doesn't work, and the new record doesn't show up in the record
count until I reopen the form. What's going on?

Cheers,

Bruce
Nov 13 '05 #1
1 1421
Bruce wrote:
I have some code that uses the recordset command to duplicate an
existing record within the same table. After updating this new record
I want the user to be able to edit it, but the bookmark lastedited
command doesn't work, and the new record doesn't show up in the record
count until I reopen the form. What's going on?

Cheers,

Bruce


If you cloned it then...I'm not sure if you are using a form or what
but....aircode follows

Dim lngID As Long
Dim rstClone As REcordset
...create new rec
rstClone.Update
rstClone.CLose
set rstClone = Nothing
lngId = rstClone!TheRecordsetprimarykey
Forms!YourFormName.Form.Requery
set rstClone = Forms!YourFormName.Form.Recordsource
rstClone.findfirst "PrimaryFieldName = " & lngID
Forms!YourFormName.Form.Bookmark = rstclone.Bookmark

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tom | last post: by
8 posts views Thread by Tom | last post: by
3 posts views Thread by AVL | last post: by
1 post views Thread by Dan Dorey | last post: by
reply views Thread by Chris | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.