I have a large MS Access 2013 application, and while adding some new logic I've come come upon an obstacle that no amount Googling has allowed me to overcome.
When I run the following code I get a
runtime error 3021: No current record.
error message when executing the last statement:
Docmd.Close acForm,"Picking"
DoCmd.DeleteObject acForm, "Picking"
DoCmd.CopyObject, "Picking", acForm, "Picking On Tablet"
The two forms listed in the code both exist and are proper. The first form (Picking) is being deleted properly in the 2nd statement. (The name has been removed from the list of form objects showing in the nav pane.)
My guess is that I need to somehow refresh the objects list before I run the 3rd statement but can't figure out how to do that. As a lark, I did try DoCmd.RefreshRecord since runtime error 3021 says "no current record" but of course this didn't work.
Am I on the right track? Any other ideas? I'm completely stumped.
DoCmd.CopyObjectanywhere on the internet and I have a black-belt in Googling. - Newd