Welcome to SPN

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

Sign Up Now!

Query with several dynamic fields

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

  1. Stephan

    Stephan
    Expand Collapse
    Guest

    Hi all,

    I am looking for help regarding my query.

    I have a table containing different information about meetings such as
    date, topic, and 3 separate keywords assigned.
    Now, I would like to create a search form (and the underlying query) so

    that the user can search for any information.
    E.G he could limit the date range by providing a start or end date, or
    provide phrases of the topic and / or one or more of the keyword
    fields.
    If any field is left blank, the query should run through the whole set
    of records.

    Any hint is greatly appreciated.

    Thanks,
    Stephan
     
  2. Loading...

    Similar Threads Forum Date
    Query about Jhatka Meat by Shooting in Head Sikh Sikhi Sikhism Aug 26, 2011
    Who is a sikh? A non sikh friend's query!! Sikh Sikhi Sikhism Apr 30, 2010
    General Query Hard Talk Sep 4, 2008
    Power of pauri's in Japji Sahib query Sikh Sikhi Sikhism Aug 17, 2006
    Sikhism a query Book Reviews & Editorials Aug 2, 2005

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    It would be possible to create a query with a WHERE clause like this:

    WHERE ((([Forms]![Form1]![txtStartDate] Is Null)
    OR ([MeetingDate] >= [Forms]![Form1]![txtStartDate]))
    AND (([Forms]![Form1]![txtEndDate] Is Null)
    OR ([MeetingDate] < [Forms]![Form1]![txtEndDate]+1))
    AND (([Forms]![Form1]![txtKeyword] Is Null)
    OR ([Keyword1] = [Forms]![Form1]![txtKeyword])
    OR ([Keyword2] = [Forms]![Form1]![txtKeyword])
    OR ([Keyword3] = [Forms]![Form1]![txtKeyword])))

    There might be better ideas, such as creating a related table of the
    keywords, so each record can be associated with whatever keywords are neeed.

    You could also avoid the inefficiency of the unused criteria with approach
    suggested in this article:
    Search form - Handle many optional criteria
    at:
    http://allenbrowne.com/ser-62.html

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Stephan" <fred_feuer_stein2001@yahoo.de> wrote in message
    news:1153207347.472129.254910@h48g2000cwc.googlegroups.com...
    >
    > I am looking for help regarding my query.
    >
    > I have a table containing different information about meetings such as
    > date, topic, and 3 separate keywords assigned.
    > Now, I would like to create a search form (and the underlying query) so
    >
    > that the user can search for any information.
    > E.G he could limit the date range by providing a start or end date, or
    > provide phrases of the topic and / or one or more of the keyword
    > fields.
    > If any field is left blank, the query should run through the whole set
    > of records.
    >
    > Any hint is greatly appreciated.
    >
    > Thanks,
    > Stephan
     

Share This Page