In my access database using VBScript I get an error telling me it cannot Paste the record, UNLESS I include a MsgBox before the PasteAppend command. Then it works fine.
Can anyone explain why this is the case and what, if anything, I can do to make it work without the MsgBox?
DoCmd.OpenForm "Cases", , , "Cases.[Case ID]=" & vCloneCase, acFormEdit = 1, acHidden = 1 'Go to the record to copy
DoCmd.RunCommand acCmdSelectRecord 'Select record to copy
DoCmd.RunCommand acCmdCopy 'Copy the record
DoCmd.RunCommand acCmdRecordsGoToNew 'Go to a new record
DoCmd.RunCommand acCmdSelectRecord 'Select the new record
MsgBox ("Go on") 'Wait for Access to catch up
DoCmd.RunCommand acCmdPasteAppend 'Paste the copied record