How do I copy and paste a record using RunCommand in Visual Basic

R

RichardXP

I have a multi record form. I want to copy an existing record and paste it
in a new record on the same form. I want to do this using a code Commands in
Visual basic.
 
P

Piet Linden

I have a multi record form.  I want to copy an existing record and paste it
in a new record on the same form.  I want to do this using a code Commands in
Visual basic.

Normally you would grab the PK of the record and append it to the same
table, letting access create the new PK.
 
R

RichardXP

Relationships have nothing to do with my question and I know what a primary
key is, just not use to seeing it as PK. If you know any visual basic please
respond.
 
G

Gina Whipp

RichardXP,

Part of the problem is you are in a newsgroup for Microsoft Access which
uses VBA (Visual Basic for Applications), not VB. See if the below links
get you what you want, if not then you will need to find a an appropiate
newsgroup. (OR did you mean VBA?)

http://www.homeandlearn.co.uk/net/nets4p10.html

http://www.google.com/search?hl=en&q=visual+basic+copy+and+paste+command&aq=f&oq=&aqi=
--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

Dirk Goldgar

RichardXP said:
Relationships have nothing to do with my question and I know what a
primary
key is, just not use to seeing it as PK. If you know any visual basic
please
respond.


I see no reason for you to be rude to someone who is trying to help you.

A very simple answer to you question is this series of VBA statements:

RunCommand acCmdSelectRecord
RunCommand acCmdCopy
RunCommand acCmdPasteAppend
 

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