Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Clone record?

Status
Not open for further replies.

OrlandoG7

Technical User
Jan 1, 2002
33
US
I need to duplicate some fields (not all fields) in my form and send them to a new record in the same form. I've read several postings about cloning records but don't understand how to implement it.

Thanks,
Orlando
 
One way id to use the Duplcate record line
then delete the ones you don't need like so

'Select record
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
'copy record
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70

DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

' Then delete the fields you don't want
Me!Name = ""
Me!Address = ""

and so on DougP, MCP
 
I tried doing this manually with the command bar and it doesn't work for me. Maybe because I have some fields that are calculated, others are locked, and there is an auto number field?
 
I thought I posted my response, but guess not. On the AfterUpdate event of the form, do this for each field you want to clone

Sub Form_AfterUpdate()

txtCloneField1.DefaultValue = """" & txtCloneField1.Value & """"

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top