Duplicate a record in a tabular subform (1 Viewer)

naterook

New member
Local time
Today, 00:42
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: 73

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:42
Joined
Aug 30, 2003
Messages
36,125
It doesn't like "pause" because it isn't a valid command. You can try DoEvents.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:42
Joined
May 7, 2009
Messages
19,241
you can also use this alternative:
Code:
With DoCmd
    .RunCommand acCmdSelectRecord
    .RunCommand acCmdCopy
    .RunCommand acCmdPasteAppend
    .GoToRecord , , acLast
End With
 

naterook

New member
Local time
Today, 00:42
Joined
Jul 8, 2022
Messages
15
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!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:42
Joined
May 7, 2009
Messages
19,241
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

Top Bottom