Access 2000 - copy the currently displayed record

A

Abay

I moved from Access 97 to 2000 and am having problems with some code set up
in access97 to copy the currently displayed data in a sub form when a
command button is pressed the commented out code is:

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

Access 2000 gives me an error on this, I checked it out in Access help and
have the code changed to:

DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, acPaste

Have tried this with and without acPaste on the end, but get the following
error:

"The comand or action "Cut" isn't available now"

Am afraid this means I can't do this with my version of Access 2000/vsn
9.0, 3821 SR-1, Visual Basic vsn 6.0

I checked the News group messages on this subject with no success, lots of
copying but not of the current record as far as I can see.

As usual an help would be greatly appreciated.

Abay
 
D

David C. Holley

Actually, a bettwer way would be to use an run an append query that
takes the values from the record and inserts them into the table. If
you're using a field that has an Autonumber, you'll have to list out
every field in the query as opposed to using an astrik as in SELECT *
 
A

Abay

Thank you for your suggestion, which is much appreciated .. I tried it out
... only problem I want the copied data top appear immediately on the screen
as it did before in Access97. Using the copy append query after I press the
"copy button" I have to exit the form display and come back in again to see
the newly copied data ...

Is there a way for the data to appear immediately as it did with the code
shown earlier .. am I dong something wrong?

Thanks in advance for a reply

Abay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top