Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136

    Question Unanswered: Parameter Form/Query/Report Issue

    I have a report based on a query. I have a parameter form for selecting criteria for the report.

    Using the parameter form, nothing shows up on my report. When I run just the query, it works fine.

    The paremeter form has two combo boxes on it. Both combo boxes have a query statement for the Row Source.

    Normally I write the following in the criteria line of the query for the report.

    [forms]![FormName]![ControlName]

    This is not working. I'm thinking it may having something to do with a query statement being the row source instead of an actual table or a saved query.

    Combo Box 1 Row Source:

    SELECT Sections.SectionID, Sections.SectionName FROM Sections ORDER BY Sections.SectionName;

    Combo Box 2 Row Source:

    SELECT Items.ItemID, Items.SectionID, Items.ItemName FROM Items WHERE (((Items.SectionID)=Forms!Parameter!Section));

    How would I write the criteria line for these fields inside the query the report is based off of? Because [forms]![FormName]![ControlName] is not working.

    The reason for the row source of the combo boxes being query statements is because I need the second combo box to populate based on the selection of the first combo box.

    Maybe there's a different way to accomplish this to have my report display the information using the parameter form.

    Any ideas would be greatly appreciated because right now I am at a loss for ideas. - I am a beginner with Access.

    Thanks!

  2. #2
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    I need to clarify my situation a little better.

    The 1st combo box in the parameter form has 2 columns, the 2nd combo box has 3 columns.

    The second combo box is based off what is selected in the first combo box. This is the reason for the columns.

    (When I don't base the 2nd combo box off the 1st one, I have only 1 column in both combo boxes - but the 2nd combo box lists all choices which I don't want - but when I do it this way, the report runs fine.)


    I can run the query and it works fine. When I open the report without the parameter form, it prompts me for the criteria (because of the query) and I enter the criteria just like I would on the parameter form and it works just fine. But when I use the parameter form - it doesn't work.

    I hope this helps explain what's happening.

  3. #3
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    I had an idea that I tried and it worked! Yeah!!!

    I placed two text boxes on the parameter form. I had the value of the first combo box display in the first text box and the value of the second combo box display in the 2nd text box.

    Then I went to the query the report is based on and changed the control names from the combo boxes to the control names of the text boxes. It worked!!

    Note: I made the two text boxes on the parameter form invisible so the user couldn't see them. All they see are the two combo boxes where they make their selection.
    Last edited by Zenaida; 11-30-05 at 00:48.

Posting Permissions

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