Results 1 to 3 of 3
  1. #1

    Changing default for command button

    I use a simple from with a find record command button. Whenever it is used it defaults to 'entire field' in search parameter. I want it to default to 'any part of field', any suggestions?

    Obviously I am new to this, I have taken CompUSA Access advanced course and found it too basic. It didn't answer my questions. I used to prgram in dBase III Plus, years ago, but got out of it. Now I find myself needing to learn Access, Any suggestions as to course or book(s) to learn from?

  2. #2
    Join Date
    Jan 2001
    Thanked 0 Times in 0 Posts

    Re: Changing default for command button

    I see two possibilities:
    1.) Before calling the Search dialog use the SendKeys statement to send the keys necessary to choose your desired search method.

    2.) Use InputBox() in the Click event of your button (or design a form of your own) to have the user enter search parameter(s) and then perform the search using the DoCmd.FindRecord statement which allows you to define the desired search mode.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Changing default for command button

    Actually, as I understand your question, you've got the find dialog pointed at the correct field, but you want it to default to "any part of field" instead of the "entire field" default, right?

    Are you using DoCmd.RunCommand acCmdFind or are you using the FindRecord action in a macro or the FindRecord method in code? I haven't had any trouble with the DoCmd.RunCommand acCmdFind defaulting to whole field once I set it to any part the first time. However, if you use DoCmd.FindRecord, you can specify the match there the same as you would in a macro.

    Here's the syntax:

    DoCmd.FindRecord findwhat[, match][, matchcase][, search][, searchasformatted][, onlycurrentfield][, findfirst]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts