Results 1 to 4 of 4

Thread: Query parameter

  1. #1
    Join Date
    Jun 2010
    Posts
    186

    Unanswered: Query parameter

    I'm used to using parameters in queries to filter information returned.
    I get alot of use out of the blank for all Like [] & "**"
    and [forms]! if I have my parameter in a dialog box

    For my current project, I have a union query that has parameters set on 2 different fields......this query is used to print reports. I created a form to pick from with 2 combo boxes. For one of them I wanted the user to be able to pick all so I typed Like [Form]![FormName]![cbo] & "**"
    it worked! it works when I tested in the query and in the report!

    Problem is, it won't work from the form. I used wizard to create a button to open the report that I checked and it works. That's it for code in the simple form. Report comes back blank.

    I truly can't figure out what I'm missing to get the form to open this report

    HAPPY FRIDAY!

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    I will be honest in that your 'it works' 'it doesn't work' has me confused as to which is which in terms of form vs report.

    Leave aside the form that simply holds the parameter and focus on the form/report that display the results: Generically of course this display is based on the record source query. Verify that works. If it does then the form/report should open fine - and if not you can inspect that aspect.

    But if the record source is not generating correctly - then perhaps your issue between the query & the form holding the parameter.

    I can't tell from the post as you have worded it, but you should be able to split the issue into 2 halves to solve.

    Hope this helps.
    www CahabaData com

  3. #3
    Join Date
    Jun 2010
    Posts
    186
    Sorry for the confusion - what I mean in other words is the query works, the form doesn't
    I can open my union query and type in test parameters
    I can open my report(same query) and type in test parameters
    - I get what I need

    I cannot select these same test parameters in the form
    returns blank

    the issue is between the query and the form and I'm not sure what it is?

    combo box to select 1st parameter
    text box to select the 2nd parameter
    i've tried 2 diff buttons - open report and run query, both return blank
    i've tried macro to open report with my query name in the filter (redundant?), blank

    so stuck on this one :-(

  4. #4
    Join Date
    Oct 2009
    Posts
    340
    your words:
    "can open my report.....- I get what I need"
    "open report .... return blank"

    ??

    fundamentally: if a query works - then that is a record source. You can source a report on that record source. You can source a form on that record source. They can share the same one, or you can dupe that query with a slight name change and source them on separate queries.

    so if one of display objects isn't working (form/report) - whip up a new one using that known working query as its record source.

    am still confused, but hope this helps
    www CahabaData com

Posting Permissions

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