Results 1 to 6 of 6
  1. #1
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55

    Clipboard on Duplicate Record

    I have a form with several data fields. I have created a command button for duplicate record. The command button works fine and copies all the data over to a new record. When I go to close the data base, a message comes up saying you have pasted a large amount of data to the clipboard - do you want to save it? How do I get rid of that message?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    you copied the data, as it said. it must be in your code. there are better ways to duplicate a record into a new entry than using a paste function. what is your code?

    I believe access throws the message after a certain amount of memory usage by copying data to the clip.

  3. #3
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by ajetrumpet View Post
    you copied the data, as it said. it must be in your code. there are better ways to duplicate a record into a new entry than using a paste function. what is your code?

    I believe access throws the message after a certain amount of memory usage by copying data to the clip.

    Here is the code

    Private Sub Duplicate_Record_Click()
    On Error GoTo Err_Duplicate_Record_Click

    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
    Exit_Duplicate_Record_Click:
    Exit Sub
    Err_Duplicate_Record_Click:
    MsgBox Err.Description
    Resume Exit_Duplicate_Record_Click

    End Sub

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    have you tried:
    Code:
    DoCmd.RunCommand acCmdCopy
    DoCmd.RunCommand acCmdPasteAppend
    ???

    I tried my own version of copying an old record long ago, and I found the code I used. Here it is:
    Code:
    Private Sub cmdfill_Click()
    
    On Error Resume Next
    
      DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
    
    Dim c As Control
      Dim rs As Recordset
        Set rs = Me.RecordsetClone
    
        Me.Painting = False
    
          For Each c In Me.Controls
            If Not TypeOf c Is CheckBox Then
              If Not TypeOf c Is Label Then
                If Not TypeOf c Is CommandButton Then
                  If Me.Controls("chk" & c.Name) = -1 Then
                    Debug.Print c.Name
                    c = rs(c.ControlSource)
                  End If
                End If
              End If
            End If
          Next c
       
        Me.Painting = True
    
      rs.Close
    
    Set rs = Nothing
    
    End Sub
    Interesting. That's not really effecient, but it works. It copies bound fields over to the new rec. HTH you!

    (there is also an API that fills and/or empties clipboard contents, but that should never really be needed).

  5. #5
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by ajetrumpet View Post
    have you tried:
    Code:
    DoCmd.RunCommand acCmdCopy
    DoCmd.RunCommand acCmdPasteAppend
    ???

    I tried my own version of copying an old record long ago, and I found the code I used. Here it is:
    Code:
    Private Sub cmdfill_Click()
     
    On Error Resume Next
     
      DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
     
    Dim c As Control
      Dim rs As Recordset
        Set rs = Me.RecordsetClone
     
        Me.Painting = False
     
          For Each c In Me.Controls
            If Not TypeOf c Is CheckBox Then
              If Not TypeOf c Is Label Then
                If Not TypeOf c Is CommandButton Then
                  If Me.Controls("chk" & c.Name) = -1 Then
                    Debug.Print c.Name
                    c = rs(c.ControlSource)
                  End If
                End If
              End If
            End If
          Next c
     
        Me.Painting = True
     
      rs.Close
     
    Set rs = Nothing
     
    End Sub
    Interesting. That's not really effecient, but it works. It copies bound fields over to the new rec. HTH you!

    (there is also an API that fills and/or empties clipboard contents, but that should never really be needed).
    I tried using this code. I created a comman button and in the click event I put

    DoCmd.RunCommand acCmdCopy
    DoCmd.RunCommand acCmdPasteAppend

    I keep getting an error on the first line
    DoCmd.RunCommand acCmdCopy
    DoCmd.RunCommand acCmdPasteAppend

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    then i guess you can't copy a record using that. It was an idea, that's all.

    You might my code instead. Other than that, i'm out of ideas. good luck though!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. If duplicate record, go to original record
    By BigBear in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 02:58 AM
  2. Duplicate Record Cannot Save
    By magicscreen in forum Programming
    Replies: 2
    Last Post: 09-15-2010, 08:15 AM
  3. Duplicate a Record
    By AKQTS in forum Forms
    Replies: 11
    Last Post: 08-09-2010, 05:25 PM
  4. If duplicate record, go to original record
    By islandboy in forum Access
    Replies: 51
    Last Post: 06-02-2010, 04:17 PM
  5. Delete record if duplicate
    By rubintheyid in forum Access
    Replies: 8
    Last Post: 03-30-2010, 11:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums