Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2013

    Unanswered: multiple search query problem


    A little background, recently i've been helping to evolve a database (ACCESS 2007) into something slicker and more user-friendly.
    Right now it consists of one table and various forms.

    My table is a number of Items (with an ID(set int), name(set names), origin(set places), checked (checkbox), date checked, double-checked (checkbox), date double-checked, notes(text))

    For now I have built a query that allows me to search the Origin of the item or showing all if left void whilst only showing those that havent been checked or double-checked.

    Query so far:
    SELECT [Itemtable].ID, [Itemtable].name, [Itemtable].Origin, [Itemtable].Checked, [Itemtable].Date checked, [Itemtable].Double-Checked, [Itemtable].Date double-checked, [Itemtable].notes
    FROM [Itemtable]
    WHERE ((([Itemtable].Origin)=[Forms]![searchform]![origin - choicelist]) AND (([Itemtable].Checked)=False) AND (([Itemtable].Double-Checked)=False))
    OR ([Forms]![searchform]![origin - choicelist] is Null) AND (([Itemtable].Checked)=False) AND (([Itemtable].Double-Checked)=False);
    I want to also be able to search for the Item name.
    so I tried to add to my coding
    WHERE (previouscode) OR ((([Itemtable].name)=[Forms]![searchform]![name - choicelist]) AND (([Itemtable].Checked)=False) AND (([Itemtable].Double-Checked)=False)) OR ((([Itemtable].Checked)=False) AND (([Itemtable].Double-Checked)=False) AND (([Forms]![searchform]![name - choicelist]) Is Null))
    However when adding this my origin search still works but the name search does not..

    Can anyone help me out with this?
    Thanks in advance!

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    if you are providing values to match against date or text columns then you must correctly delimit those values

    where mydatecolumn = #2013/12/19# or mystringcolumn = 'makanko'
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

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