Copy Paste Record

shift2076

Registered User.
Local time
Today, 11:43
Joined
Feb 5, 2007
Messages
51
Hi all,

I have another problem on my vacation request forms. Everything is working perfectly except on the the new request form. When I click on the 'add a date' button, the code is supposed to save the record, then copy and paste it, so I should end up with two copies in the database. No matter how I arrange the code, I can't get the second copy of the record to show up. I tried to copy and paste it twice at which point some of my fields came up blank.

Yesterday, I was having a similar problem and found out it was due to fields that were locked and disaled. I have no locked fields on this form though.

Anyone know how I can get two copies of a record in my database?

Thank you,
MJ
 
I have an idea, but not sure of the code...

From the 'new request form' the date is then entered in a seperate form for the 'add a date'. Now, if I can have coding in the on open event of the 'add a date' form that basically says - if refering form was 'new request form' then copy and paste record.

Maybe something like that would work... if there's no way to do it from the command button itself on the 'new request form'.
 
Solution

Problem's fixed. If anyone out there is looking for the answer to a similar problem -

DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste

The code that access uses for it's duplicate record button didn't work in this case, even with the acCmdSaveRecord placed before it. I don't feel the love Mr. Gates. :(

MJ
 

Users who are viewing this thread

Back
Top Bottom