Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006
    Posts
    11

    Question Unanswered: Search all fields...

    I'm looking for an example of code behind a command button. I have a search form with two user-input text boxes. All matching records will display in a another form.

    Anyone know of a sample I could work from?

    --Kavanaugh

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Lookup the OpenForm method of DoCmd. One of the parameters allows defining a Filter. This requires learning some basics of SQL, as the filter is a Where clause without the word Where. It is pretty easy to learn, however.

    Example:
    Field is a number, and it is called PartKey. If I want the records where PartKey is greater than 23, the text is: "[PartKey] > 23"

    You can use the query builder to help you learn how to wite basic SQL - after you create a query that does what you want, switch to SQL view to see how you would write it.

  3. #3
    Join Date
    Apr 2006
    Posts
    11
    Thank you. I wish it were as simple as you say. I have been trying everything I can think of in VB to make it work.

    The user's goal is to find a vendor that performs a particular job (criteria 1) in a particular location (criteria 2). The tricky part is that some vendors perform various jobs in various locations (i.e. multiple fields).

    --Kavan

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    more complicated than you need, but example

    izy
    currently using SS 2008R2

Posting Permissions

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