Copy record by clicking a button?

H

Harmannus

Hallo,

How can i copy the content of my records on my form (so fields in my table)
to a new record?

so records,
id1
meeting1
location1

becomes
id2
copy of meeting1
copy of meeting1

I would like to do this by clicking a button. Tried some coding in VBA but
get stuck on identifing the current active record.

Any suggestion on how to inform the user of the fact that the copy succeeded
and that he/she is now seeing the copy?

Thanx in advance for any tips.

Regards,
Harmannus
 
H

Harmannus

Typing error :)

so records,
id1
meeting1
location1

becomes
id2
copy of meeting1
copy of location1
 
D

Dirk Goldgar

Harmannus said:
Hallo,

How can i copy the content of my records on my form (so fields in my
table) to a new record?

so records,
id1
meeting1
location1

becomes
id2
copy of meeting1
copy of meeting1

I would like to do this by clicking a button. Tried some coding in
VBA but get stuck on identifing the current active record.

Any suggestion on how to inform the user of the fact that the copy
succeeded and that he/she is now seeing the copy?

I'm not sure if there are specific circumstances in your case that would
prevent its use, but the command button wizard has an option to build
just such a button. In the wizard's dialog, choose category "Record
Operations" and action "Duplicate Record". The wizard-generated code
may not be the best around -- as I recall it uses DoMenuItem to
accomplish the equivalent of

RunCommand acCmdSelectRecord
RunCommand acCmdCopy
RunCommand acCmdPasteAppend

-- but it gets the job done.

If no error is raised, the user will be on the newly pasted record. So
if necessary you can simply display a message box to that effect.
 

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