• Parameter Queries (2000 SR-1)

    Author
    Topic
    #1770080

    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?

    Viewing 1 reply thread
    Author
    Replies
    • #1785877

      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.

    • #1787783

      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.

    Viewing 1 reply thread
    Reply To: Parameter Queries (2000 SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: