Results 1 to 2 of 2
  1. #1
    Join Date
    May 2008

    Unanswered: Return All/Selected Records with two Combo Boxes

    I have a form that using two combo box to select specific record or all records.

    I would like if the combo box if left empty, in any of them, it displays all the records.

    When I used both the combo box as filled or as empty, it is perfectly working but when I opt one combo box as filled and another as empty, no records are showing.

    Following is the Query, which I am using for the above:

    SELECT Contract.ContractNo, Contract.Supplierid, Contract.Itemid
    FROM Contract
    WHERE (((Contract.Supplierid)=[Forms]![Form]![Selectparty]) AND ((Contract.Itemid)=[Forms]![Form]![Selectitem])) OR ((([Forms]![Form]![Selectitem]) Is Null) AND (([Forms]![Form]![Selectparty]) Is Null))
    ORDER BY Contract.ContractNo DESC;

    Kindly help to resolve this problem.

  2. #2
    Join Date
    May 2005
    I prefer to build the query dynamically in VBA and then apply as needed.
    Me.Geek = True

Posting Permissions

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