Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Thanked 0 Times in 0 Posts

    query criteria (2002)

    I have created a query and I have the query to read data from a form and then use it to run the query.


    Then I want to put another criteria in the or line so that the query would also work if I got data from another form.


    After saving the query I get this on the criteria line.

    [Forms]![frmPrintSummaryData]![SchoolYear] Or [Forms]![frmPrintDivisionData]![SchoolYear]

    This does not work. The query asks for the same data from both forms before it will run.

    Any ideas on how to make this work?



  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: query criteria (2002)

    Criteria that refer to a form can only be evaluated if that form is open, so it is not possible to refer to two forms of which only one is open.

    The easiest workaround is to create two queries - one that refers to frmPrintDivisionData and another that refers to frmPrintSummaryData, and use the one that is appropriate to the situation. Otherwise, you'd have to use VBA code.

Posting Permissions

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