Results 1 to 6 of 6
  1. #1
    Star Lounger
    Join Date
    Aug 2001
    Location
    Can Jose, CA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    combo box in form based on criteria query (2k)

    I have a form based on a selectable criteria query. When I try to create a combo box using the wizard to find records on the form, it displays the error "No value given for one or more required papameters" at the display field wizard point. I'm sure this is associated around the criteria needing to be defined for the combo box. Is there a way to enter the criteria for the ROW SOURCE property or another way to perform this function?

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

    Re: combo box in form based on criteria query (2k)

    Create a copy of the query without parameters. Set the record source of the form to this query temporarily. You should be able to run the combo box wizard now. Then set the record source back to the original query.

  3. #3
    Star Lounger
    Join Date
    Aug 2001
    Location
    Can Jose, CA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box in form based on criteria query (2k)

    Thanks for response.
    Your suggestion allowed creation of the combo box but it then displays all records in the the table behind the query and not just the ones associated with the criteria after the record source set back to original.

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

    Re: combo box in form based on criteria query (2k)

    Ok, here is the next step. I can't fill in all the details for you, not knowing your query.

    I'll try to explain it by an example based on the Customers table in the Northwind database; you will have to substitute the appropriate names.

    Let's say you have created a query qryCustomers based on the Customers table, with a criteria [Which Country] in the Country column. So if the user would open the query, an input box labeled Which Country is shown; if the user enters USA, only customers in the USA are displayed.

    In the form based on qryCustomers, you have a combo box to search for a Company Name. The Row Source for this combo box will look like

    SELECT DISTINCTROW [Customers].[CustomerID], [Customers].[CompanyName] FROM [Customers];

    Now we will have to restrict this to customers from the selected country. Change the Row Source to

    SELECT DISTINCTROW [Customers].[CustomerID], [Customers].[CompanyName] FROM [Customers] WHERE [Country] = [Form]![Country];

    This limits the records returned in the combo box.

    I hope that you will be able to translate this example to your own situation.

  5. #5
    Star Lounger
    Join Date
    Aug 2001
    Location
    Can Jose, CA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box in form based on criteria query (2k)

    I have entered the combo box property as:
    SELECT DISTINCTROW [gener-form-data].[Program], [gener-form-data].[S/N], [gener-form-data].[PWAtype] FROM [gener-form-data] WHERE [program]=[Form]![program];
    PROGRAM is the criteria field. This now causes the box to not show anything in the list.
    I will look up the Northwinds form example you cited

  6. #6
    Star Lounger
    Join Date
    Aug 2001
    Location
    Can Jose, CA
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: combo box in form based on criteria query (2k)

    Got it. I missed it in your explanation the first time. I entered the query name in the SELECT DISTINCTROW [gener-form-data] instead of the TABLE name. It now works exactly like it need it too. Thanks for the help. I think this is the second time your assistance had helped me through a problem. Have a good holiday.

Posting Permissions

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