• Find dialog box (Access 97)

    Author
    Topic
    #371540

    Is there a way of setting the value of Match to be “Any Part of Field” instead of the default “Whole Field” when the Find dialog box is displayed using an Event Procedure?

    I am using: DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

    Thank you. aussie

    Viewing 0 reply threads
    Author
    Replies
    • #590835

      Have a look at Post 32585 and Post 135633.

      • #590838

        Thanks for the advice Hans … I actually looked at these postings before posting my own question because as an ignorant beginner I did not understand how to apply those suggestions to my situation.

        My Find button is working fine, except it displays the dialog box with the Access default Match condition of “Whole field” instead of “Any part of a field”.

        So, I was hoping that someone may know the appropriate switch for this that I could add to the command I am using:

        DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

        If there is no such switch (I couldn’t find it), then perhaps suggesting the actual line of code to use instead of the above, to display the Find dialog box with the Match set to “Any part of a field”.

        Thank you. aussie

        • #590842

          In the first place, you should replace the antiquated DoMenuItem by RunCommand (see below). According to Microsoft, you can use SendKeys to set the matching option. But many experts will warn you that using SenKeys is flaky, so use it at your own risk. And it is language-dependent, since the accelerator keys in dialog boxes are different for each language.

          You can use the following for the English language version of Access 97:

          SendKeys “%ha%n”
          RunCommand acCmdFind

          See KB article 120912

          • #590848

            Thank you very much for taking the time to help me Hans … I replaced the antiquated Access 2.0 code I was using with the one you suggested and it works perfectly … thanks also for the Knowledge Base article explaining it all.

            You’re great! aussie

    Viewing 0 reply threads
    Reply To: Find dialog box (Access 97)

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

    Your information: