Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    parameter query for two fields (Xp, 2000)

    I have a table that has several fields - two of which are "original name" and "current name". In my parameter query, I would like the user to enter one name and have the query search both fields for that name. Is this possible?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: parameter query for two fields (Xp, 2000)

    Yes it is. Just enter the required name in alternate lines of the criteria of the query under each of the required fields.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: parameter query for two fields (Xp, 2000)

    Yes, you can enter the same parameter for both fields, for example [Which Name]. Access will prompt only once for the parameter. Make sure that the spelling of the parameters is exactly the same in both cases.

    If you put both parameters in the same Criteria row, it will be an AND condition: [Original Name]=[Which Name] And [Current Name]=[Which Name]

    If you put the parameters in different Criteria rows, it will be an OR condition: [Original Name]=[Which Name] Or [Current Name]=[Which Name]

  4. #4
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: parameter query for two fields (Xp, 2000)

    Thank you all so much. Forgot about the multiple criteria lines.

Posting Permissions

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