Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Pendleton, Indiana, USA
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selecting a Criteria (2000)

    I have a report that runs from a query and it prompts you to enter a Location value, I was wondering if anyone would be willing to tell me if I can populate that and turn it into a dropdown or combo box so you can just select the location.

    Thanks

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

    Re: Selecting a Criteria (2000)

    You need to create a form for that.
    Put an unbound combo box on the form, let's call it cbxLocation.
    If you have a separate table containing a list of all locations, you can use that table, or a query based on it, as Row Source of the combo box.
    If you want to list all locations occurring in a table (which may contain duplicates), set the Row Source to SELECT DISTINCT [Location] FROM [tblSomething] (with the appropriate field name and table name substituted, of course.)
    You will probably want to put a command button on the form that opens the report.
    Save the form, let's say you name it frmSelect.
    Open the query in design view, and replace the parameter (probably something like [Enter Location] now) by a reference to the combo box: [Forms]![frmSelect]![cbxLocation], again with the names you actually used. Check carefully that the reference is spelled correctly.
    If you open the report from the form, it will use the location selected in the combo box. If you open the report by itself, while the form is not open, you will get prompted for a parameter.

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Selecting a Criteria (2000)

    The only way to handle that situation is to create a form that has a combobox on it with your Locations. The report would then be opened from the form. The query would reference the combobox on the form for its criteria value, in place of the [Enter the Location] prompt you are probably currently using.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Star Lounger
    Join Date
    Sep 2002
    Location
    Pendleton, Indiana, USA
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting a Criteria (2000)

    Thank you both for the input, I will start working on it now.

    Trent

Posting Permissions

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