By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Cloning a record

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.