Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2004, 01:36 PM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trouble creating a Copy Record command on a Form

Hi there,

I'm trying to create a Copy record button on my form but
am not having any luck doing it.
I've tried to use the "Duplicate Record" function in the
Command Button wizard but it's giving me the "Action or
command PasteAppend is not available now."

The form [frmDmJobInfo] is controlled by the query
[qryDmJobTracking]which is comprised of a table & query
[tblDmJobTracking] & [qryDmJobInfo](this query is a combo
of a table [tblDmJobInfo]and another query).

The basic code below is the one you get from the wizard
for the Duplicate Record command button: (I know this code
isn't right for what I need to do, but I'm not sure how to
construct one that will make a copy of the record on that
form [frmDmJobInfo] and paste append it to the proper
tables [tblDmJobTracking] & [tblDmJobInfo] (Both of these
tables have an Autonumber field in them).
Any help would be very much appreciated.

Thanks,
Ron
--------------------------------------------------
Private Sub cmdCopyDMrecord_Click()
On Error GoTo Err_cmdCopyDMrecord_Click


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

Exit_cmdCopyDMrecord_Click:
    Exit Sub

Err_cmdCopyDMrecord_Click:
    MsgBox Err.Description
    Resume Exit_cmdCopyDMrecord_Click

End Sub




Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy command not working nayaz VBScript 1 July 5th, 2007 05:24 AM
Creating or Editing a record from a form Brian263 Access 3 October 18th, 2004 11:42 PM
trouble creating array Tachyon Beginning PHP 3 June 28th, 2004 11:25 AM
trouble adding new record TnTandyO Classic ASP Databases 1 November 4th, 2003 02:20 PM
trouble w/ command object and parameters RbH All Other Wrox Books 0 August 5th, 2003 12:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.