Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271

    Unanswered: Copy current record, do I need to add...

    This is the code I have to copy a record. Do I need to add DoCmd.GotoRecord new before I paste? Or does it matter?

    Private Sub CopySample_Click()
    Me!SampleNumber.SetFocus
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.RunCommand acCmdCopy
    DoCmd.RunCommand acCmdPasteAppend
    DoCmd.GoToControl "SampleNumber"
    End Sub

    Thank You,
    MIchael
    Gotta to do some code

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    This may not work as you would expect especially in all views. Create a sample DB and try it.


  3. #3
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    Is this the exact way to enter it in my code?

    DoCmd.GotoRecord new
    or
    DoCmd.GotoRecord "new"
    or
    DoCmd.GotoRecord(new)

    I'm pretty new to this code stuf!!
    Michael
    Gotta to do some code

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    DoCmd.GoToRecord acDataForm, "myFormName", acNewRec
    DoCmd.GoToRecord acDataTable, "myTableName", acNewRec



    See your MS-Access Help with regards to the GotoRecord function.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •