Question on Queries & Forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy

    Question on Queries & Forms

    Hello everybody

    I have a question on running queries via a form. My situation is – I
    have a query (qrysearch) and this query has a number of fields e.g.
    (company, employee etc). My form is linked into the query and has the
    same fields as the query. I would like to use my form as a way of
    searching for records by typing in text in the appropriate text boxes
    on the form.

    Currently, I can link the form fields into the query, however, the
    query doesn't pull back any data unless the user enters a criteria in
    each of the forms text boxes. I would like to know if there is a way
    of running the query without having to enter data into each text box
    on the form e.g. just entering data in the ‘company' field and leaving
    the ‘employee' field blank or visa versa.

    Many Thanks for your assistance
    Andy
  • Reggie

    #2
    Re: Question on Queries & Forms

    Andy you could use criteria like below in your query. This will return the selected record, or if
    none selected will return all of them.

    =Forms!frmName! fldName Or Forms!frmName!f ldName Is Null

    Hope this helps!
    --
    Reggie

    ----------
    "Andy" <wallaceaj11@ho tmail.com> wrote in message
    news:56aafad9.0 408131120.61590 016@posting.goo gle.com...[color=blue]
    > Hello everybody
    >
    > I have a question on running queries via a form. My situation is - I
    > have a query (qrysearch) and this query has a number of fields e.g.
    > (company, employee etc). My form is linked into the query and has the
    > same fields as the query. I would like to use my form as a way of
    > searching for records by typing in text in the appropriate text boxes
    > on the form.
    >
    > Currently, I can link the form fields into the query, however, the
    > query doesn't pull back any data unless the user enters a criteria in
    > each of the forms text boxes. I would like to know if there is a way
    > of running the query without having to enter data into each text box
    > on the form e.g. just entering data in the 'company' field and leaving
    > the 'employee' field blank or visa versa.
    >
    > Many Thanks for your assistance
    > Andy[/color]


    Comment

    Working...