Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

RE: How do i use a form to input criteria into queries

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

  1. troubledinaccess

    troubledinaccess
    Expand Collapse
    Guest

    "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
    query.
    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...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page