Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2005

Tip: Looking for answers? Try searching our database.

After Duplicating a Record, How do you delete the relationship???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michelle - 03 Feb 2005 19:23 GMT
All I am trying to do is to copy a previous record into a new one - more like
prefilling a form based on the values of the previous record.  I added a
command button for that using the wizard and right there is the duplicate
record button.  it works fine.  however, i would need to edit my now new
record to reflect some minor changes like the of the record.  For some reason
I don't know, once I edit the new record, the contents of the old record gets
erased!  

Why is that and how can I stop this?

Thanks a million!
John Vinson - 03 Feb 2005 22:49 GMT
>All I am trying to do is to copy a previous record into a new one - more like
>prefilling a form based on the values of the previous record.  I added a
[quoted text clipped - 7 lines]
>
>Thanks a million!

Please post the wizard code. That shouldn't be happening! What's the
Primary Key of the table? Are you assigning a new value for the new
record?

                 John W. Vinson[MVP]    
Michelle K - 04 Feb 2005 12:53 GMT
This is the code behind the button.  The primary key is called MainIndex and
when I look at the form in the datasheet view (I even went ahead and
displayed the primary key on the form), they are completely separate.  It's
totally driving me nuts!  It's not supposed to be rocket science!

Thanks.  Just venting and quite frustrated.

Private Sub cdmDuplicate_Click()
On Error GoTo Err_cdmDuplicate_Click

   DoCmd.RunCommand acCmdSelectRecord
   DoCmd.RunCommand acCmdCopy
   DoCmd.RunCommand acCmdPasteAppend
   

Exit_cdmDuplicate_Click:
   Exit Sub

Err_cdmDuplicate_Click:
   MsgBox Err.Description
   Resume Exit_cdmDuplicate_Click
   
End Sub

> >All I am trying to do is to copy a previous record into a new one - more like
> >prefilling a form based on the values of the previous record.  I added a
[quoted text clipped - 13 lines]
>
>                   John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.