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

  • Thread starter Thread starter RichardXP
  • Start date Start date
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.
 
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.
 
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.
 
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
 
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
 
Back
Top