Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

RE: How Do I Use A Form To Input Criteria Into Queries

Discussion in 'Information Technology' started by troubledinaccess, Jul 28, 2006.

  1. troubledinaccess

    Expand Collapse

    "malonic" wrote:

    > Many Thanks. All the answers were useful
    > "malonic" wrote:
    > > I need to type data in to several fields on a form and then run a query using
    > > these field to find matching data from a table

    Another option to do this would be create your query with based off of your
    table you want to poll from.
    Then create a form with unbound text boxes to use for the query criteria.
    Using the controls wizard place a command button on your form set to run your
    Next go back into your query and set your criteria as follows substituting
    your table and form names:

    (tblWorkOrders.[Work Order Number]) Like "*" &
    [Forms]![frmWorkOrdersSearch]![Work Order Number] & "*" Or
    tblWorkOrders.[Work Order Number] Is Null

    For date ranges I added the date fields from my table to my query and then
    created new fields in my query for each set of ranges I was wanting to be
    able to poll from:

    ((tblWorkOrders![Actual Complete Date]) Between
    [Forms]![frmWorkOrdersSearch]![From Actual Complete] And
    [Forms]![frmWorkOrdersSearch]![To Actual Complete] Or
    [Forms]![frmWorkOrdersSearch]![From Actual Complete] Is Null And
    [Forms]![frmWorkOrdersSearch]![To Actual Complete] Is Null)

    In the criteria for this field enter: <>False

    I have this set up with six different data fields and six different from
    and to date fields in my form and it works like a charm, can enter any
    combination of criteria and or dates with results.

    Hope this helps,
  2. Loading...

Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     

Share This Page