Duplicate a record in a tabular subform

naterook

New member
Local time
Today, 10:09
Joined
Jul 8, 2022
Messages
15
Hey everyone. I can't figure out why this works only sometimes. I have a Tabular (continuous) subform. I've added a Duplicate Record button to duplicate my subform records. However, I click on it once or twice and it works. Then I click again and it gives me the error 'The command or action 'Paste' isn't available now'.

I think I've even gotten as far as the 4th click before this error comes up...

Any ideas on why this sometimes works and sometimes doesn't?
 

Attachments

  • paste.PNG
    paste.PNG
    56.5 KB · Views: 121
It doesn't like "pause" because it isn't a valid command. You can try DoEvents.
 
you can also use this alternative:
Code:
With DoCmd
    .RunCommand acCmdSelectRecord
    .RunCommand acCmdCopy
    .RunCommand acCmdPasteAppend
    .GoToRecord , , acLast
End With
 
you can also use this alternative:
Code:
With DoCmd
    .RunCommand acCmdSelectRecord
    .RunCommand acCmdCopy
    .RunCommand acCmdPasteAppend
    .GoToRecord , , acLast
End With
Perfection!
Is it the PasteAppend that's fixing it? In other words, if it's just 'paste', is it going to fast, but if it's paste append, it's not pasting it in the current field, but instead adding it to the bottom of the table?

Thank you for this!
 
s it going to fast, but if it's paste append, it's not pasting it in the current field, but instead adding it to the bottom of the table?
you need to test it to see for yourself.
 

Users who are viewing this thread

Back
Top Bottom