Multiple selections

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stevenrec

    #1

    Multiple selections

    Hi all,

    looking for a direction on how to accomplish something someone has
    surely done before:

    Have a List Box with article desciptions.
    Want 3 text boxes where someone enters what they are looking for.
    Dealing with chemicals, there are several ways to write the same thing
    (order of words)

    In box 1 "*tetra*", box 2 "*meth*" and in box 3 "*prop*"

    I want it to find

    1-Tetramethylprop anol (in the order above)
    4-Methanolpropylt etrachlorine (same words, different locations)
    2,4-Propyl-2-methoxyl-1-tetrazin (again different locations)

    Reayyl need general ideas how to best get there without taking a huge
    performance reduction.

    Thanks

  • storrboy

    #2
    Re: Multiple selections

    So using the three text boxes like that should return anything
    containing all those values, or anything containing one or more?
    Depending on that question, I imagine creating a sql string that has
    the three boxes Or'd or And'd together as criteria would do it. You'd
    have to account for the possibility of them not being filled in. After
    clicking a "Search" button perhaps, you would in code determine which
    to include in the string, contrsuct the sql, apply it to the listbox
    RowSource property and requery it. If you need specific help, then you
    might need to provide more detail about the controls, query fields and
    criteria requirements.

    Comment

    • Don Leverton

      #3
      Re: Multiple selections

      Now these are just some of those "half-baked ideas" ...

      If a guy ("a guy" being the original poster) was to lookat the "Advanced
      Search" page at Google
      http://www.google.ca/advanced_search?hl=en and design an input form in
      Access similar to that ...

      and then if "a guy" was to follow storrboys idea of building an sql
      statement in code ...
      I even have some sample code, posted in 2002, that you could use as a
      starting point


      And if "a guy" had a datasheet style subform that used the resulting SQL as
      it's RecordSource ...
      then maybe "a guy" could duplicate this functionality?

      Other options ???
      =============
      In
      InStr
      Like
      FindRecord
      =============
      OR

      "Roll your own" version of the FindRecord dialog box ... plugging search
      data and search methods in from form references ???

      Option Compare Database
      Option Explicit

      Dim vFindWhat
      Dim vMatch
      Dim vMatchCase As Boolean
      Dim vSearchDirectio n
      Dim vSearchAsFormat ted As Boolean
      Dim vOnlyCurrentFie ld
      Dim vFindFirst As Boolean

      'DoCmd.FindReco rd findwhat[, match][, matchcase][, search][,
      searchasformatt ed][, onlycurrentfiel d][, findfirst]
      'findwhat An expression that evaluates to text, a number, or a date. The
      expression contains the data to search for.
      'match One of the following intrinsic constants:
      'acAnywhere
      'acEntire (Default)
      'acStart
      'If you leave this argument blank, the default constant (acEntire) is
      assumed.
      'matchcase Use True (-1) for a case-sensitive search and False (0) for a
      search that's not case-sensitive. If you leave this argument blank, the
      default (False) is assumed.
      'search One of the following intrinsic constants:
      'acDown
      'acSearchAll (Default)
      'acUp
      'If you leave this argument blank, the default constant (acSearchAll) is
      assumed.
      'searchasformat ted Use True to search for data as it's formatted and False
      to search for data as it's stored in the database. If you leave this
      argument blank, the default (False) is assumed.
      'onlycurrentfie ld One of the following intrinsic constants:
      'acAll
      'acCurrent (Default)
      'If you leave this argument blank, the default constant (acCurrent) is
      assumed.
      'findfirst Use True to start the search at the first record. Use False to
      start the search at the record following the current record. If you leave
      this argument blank, the default (True) is assumed.

      --
      HTH, (like I said ... half-baked)
      Don
      =============== ==============
      E-Mail (if you must) My.Name@Telus.n et

      Disclaimer:
      Professional PartsPerson
      Amateur Database Programmer {:o)

      I'm an Access97 user, so all posted code samples are also Access97- based
      unless otherwise noted.

      =============== =============== =============== =============== ==============


      "storrboy" <storrboy@sympa tico.cawrote in message
      news:1175777668 .941805.36390@w 1g2000hsg.googl egroups.com...
      So using the three text boxes like that should return anything
      containing all those values, or anything containing one or more?
      Depending on that question, I imagine creating a sql string that has
      the three boxes Or'd or And'd together as criteria would do it. You'd
      have to account for the possibility of them not being filled in. After
      clicking a "Search" button perhaps, you would in code determine which
      to include in the string, contrsuct the sql, apply it to the listbox
      RowSource property and requery it. If you need specific help, then you
      might need to provide more detail about the controls, query fields and
      criteria requirements.
      >

      Comment

      Working...