First I copied an ID number from a spreadsheet in Excel and moved to Access. Then I run this code from a key to set the focus in the ID field and open the find box.
Me!Acc.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Now I want to paste the ID# which is in the clipboard into the find box. Maually I would just hit ^V. Can’t seem to find the right combination. Neither of the following work:
DoCmd.RunCommand acCmdPaste
DoCmd.DoMenuItem acFormBar, acEditMenu, 3, , acMenuVer70
Both return an error message “The type of object the action applies to isnt currently selected or isnt in the active view.” I suppose that means you cant run a menu command in a find dialog box.
So what is the code equivalent to ^V
All of the “goto” and “search for” codes want me to specify the search criteria in advance. But I want to search for something new everytime.