parameter queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jennyp29
    New Member
    • Sep 2006
    • 18

    parameter queries

    When setting up a parameter query is it possible for the parameter dialogue box to have a combo or list box, so that a restricted reply can be entered? If so, how would I do it?
  • birchw
    New Member
    • Oct 2006
    • 19

    #2
    Rather than have the parameter in the query, create an unbound form and add a combo box control to the form. In the rowsource property of the combo box, make this the table that you are getting the data from (whatever table your query is looking at). If you now open the form, the combo box will contain the data on the table. You can use this combo box to select data from the query, by replacing your parameter in the query with the name of the combo box on the form - instead of [Enter Value], it will be something like [Forms]![Form1]![Combo1].

    The result of the query will now be based upon what you select from the combo box.

    Comment

    • jennyp29
      New Member
      • Sep 2006
      • 18

      #3
      Originally posted by birchw
      Rather than have the parameter in the query, create an unbound form and add a combo box control to the form. In the rowsource property of the combo box, make this the table that you are getting the data from (whatever table your query is looking at). If you now open the form, the combo box will contain the data on the table. You can use this combo box to select data from the query, by replacing your parameter in the query with the name of the combo box on the form - instead of [Enter Value], it will be something like [Forms]![Form1]![Combo1].

      The result of the query will now be based upon what you select from the combo box.
      Thank you birchw for your information, that has worked a treat. Just one thing, as I am creating this data base for others to use, how can I change what the parameter dialogue box now says ie. form!frmCombo!C ombo6. I would like it to say "Enter Course Number"

      Comment

      • birchw
        New Member
        • Oct 2006
        • 19

        #4
        To change the name of the combo box, just change the Name property of the combo box to EnterCourseNumb er (try not to use spaces for field names).

        If you want Enter Course Number to appear on the form, just edit the label and change the Caption property.

        Comment

        Working...