• Paste into Find Dialog Box (office pro 97 access)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Paste into Find Dialog Box (office pro 97 access)

    • This topic has 7 replies, 4 voices, and was last updated 23 years ago.
    Author
    Topic
    #369241

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #580914

      Throw away the Access 95 code and use the Access constants instead. Try this:

      DoCmd.RunCommand acCmdFind

      and this

      DoCmd.RunCommand acCmdCopy

      It isn’t completely clear what you’re trying to do here, though. Did you copy the value using code? If so, why are you using the Find dialog at all when you could do a find on the recordset in code? If not, why try to use code to paste the value into the Find dialog?

      It would be handy if Access had a Dialogs collection the way Word and Excel have, but I’m afraid we’re out of luck there.

      • #580993

        Tx Charlotte

        All I want to do is tell it to go find a ID# and update that entry. But I don’t want to have to type the ID number in every time. I want to bring it from a cell in an Excel spreadsheet. Right now I simply copy the cell in Excel, move to Access, Open Find and Paste. Then I run a command button which does the update. I would like to incorporate the “Find” into the beginning of the update code.

        I looked at the recordsets info and it is way to complicated for me. Actually “seek” seems to be sort of what I want, but it looks as if it wants to work with tables and I want to search in a form.

        Currently I am using the old Macro writer from Win3.1. I have drug that along with me through every windows upgrade. I can use it to write one macro which spans both Excel and Access. Guess I will stick with that. Just thought maybe I was missing something in the Access codes. Still seems like there should be an easy way to tell it to go Find “paste in variable” and
        update it.

        If I had know you had to be a programmer to make Access work for you I would have stuck with my old PCButton shareware database.

        Anyway Thanks again…

        • #581023

          You don’t have to be a programmer to make Access work, only to make it work the way you *want* it to. crazy You’re dealing with extensions of Windows here, and that has come a long way since 3.1.

      • #581789

        Hi Charlotte

        In a2k I notice wizards generate doCmd.DoMenuItem code.

        Is there a utility that will change DoMenuItem to RunCommand?

        How long will DoMenuItem be supported?

        Should I worry about it?

        Thanks, John

        • #581820

          Well, logically they have to keep supporting it since their wizards are still writing Access 95 code. shrug I don’t know of any utility, although there’s probably one out there somewhere. I don’t use the wizards very often, so I haven’t bothered to look for anything to fix their stale code.

    • #581077

      I think that you are looking for “SendKeys”, but this is not the best way to do things and can catch you out sometimes!

      HTH

      Peter

      • #581745

        Tx Peter I haven’t looked at SendKeys at all. Will give that some study in the near future.

        At least I now I know I haven’t missed anything obvious — this time.

    Viewing 1 reply thread
    Reply To: Paste into Find Dialog Box (office pro 97 access)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: