Results 1 to 3 of 3
  1. #1
    Will Perry

    Parameter Queries (2000 SR-1)

    I would like to use a QBE parameter query to have the user select the field to use in the query. Does anyone know of a way to do this?

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 41 Times in 40 Posts

    Re: Parameter Queries (2000 SR-1)

    This can't be done using a parameter query. Access will treat the user input as a value, not a field name.

    You would have to have your own frontend form, then through code manipulate the QueryDef.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Star Lounger
    Join Date
    Sep 2001
    SC, USA
    Thanked 0 Times in 0 Posts

    Re: Parameter Queries (2000 SR-1)

    I'm not exactly sure what you're trying to do, but I think you're saying that you have an existing query, and you want a user to be able to select records based on the field of their choice (i.e. Begin_Date, Last_Name, SSN_Num). The user may know the last name of a customer, but not the social security number (or visa versa). Or they may need to select all data for a particular date. For this example, I would simply make three copies of the same query, but one query has "Enter Begin Date" as the criteria in the "Begin_Date" column, the second query has "Enter Last Name" as the criteria in the "Last_Name" column, and the third query has "Enter SSN Number" as the criteria in the "SSN_Num" column. On your form, have three buttons labeled appropriately so that users can then choose how they want to select data. If you just want to display the data, just have the buttons open the correct query. If you want the results on a form or report, things get a little more complicated, but I would just have three identical forms or reports (named slightly different) and let the buttons open the appropriate form/report, which would be based on the corresponding query.

Posting Permissions

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