Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    I agree the mix and match scenario you refer to would be a bit more challenging. But at the risk of repeating myself, my interpretation based on the original post was not to mix and match but to supply one or the other possibility. To that end I said use option buttons with labels that define what the selection means: One for records where all criteria must be present, one for records where any are present. If you want to do what you said, I guess I'd put combos in between textboxes for operators and read it right to left.
    Foo AND bar OR Dis And Dat


    I don't recall ever doing that, but I don't see why I couldn't replace the actual operators with the combobox values (e.g. AND or OR). I just might take a whack at it for fun. If anyone has any 'heads up' things to consider, they could be useful comments.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  2. #17
    RobOtowski is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    May 2014
    Posts
    16
    Just to clarify what it is that I am looking for:
    The form would have four blank Text Boxes. Users enter maximum of one search term per box. User selects "search for tickets that contain ALL of the search terms" or they select "search for tickets that contain ANY of the search terms". So option 1 ("and") would be something like "search for 'proj' AND '129' AND 'fire'" and option 2 ("or") would be something like "search for 'proj' OR '129' OR 'fire'".

    It is possible that down the road I may want to create a search that lets you mix ANDs and ORs so you could search something like (("proj" AND "129") OR ("fire" AND "202")), but at the moment I think that is too much for my users to understand, let alone utilize, so it's an extremely low priority. However, don't let me stop you all from discussing it! I'm still learning quite a lot from this thread and I thank you all!

  3. #18
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Apparently I misunderstood the question.

    So I agree with Micron , use an option group or a combo box to select "AND" or "OR".
    I still don't like to modify/replace the record source of a form(while not in design view); I still prefer to set a filter.

    It would be extremely easy to modify Allen Browne's code to be able to use an option group or a combo box to select "AND" or "OR". The code only uses (searches/filters) the controls ("Tag1", "Tag2",...) that are not blank/NULL. (The code is at http://www.allenbrowne.com/ser-62code.html)

    In the header, have the four controls, an option group/combo box, and 2 buttons: "Search" & "Clear Search".

  4. #19
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    As I said, I thought I'd take a poke at this and came up with this design, based on the Northwind Orders table. I did some coding around date validation and putting together the button click, but didn't finish it. I got the notion I might be able to make something that could examine any table or query and build a continuous form with operators (>,=,>= etc.) suitable to the data types of the fields. The challenge, as always with continuous forms, would be how to handle the form's inability to display different operator values in the combo boxes on each row. I have an idea germinating on how to fake that, but need time to try it out.

    Robotowski, if the picture looks like something you could use, PM me and let me know and I'll see what I can do to accomodate you.
    To explain the image: Where Country = value AND City = value AND Customer = value AND Order Date > value AND Required Date > value OR shipper = value. Note that there is no grouping possible (this AND that) OR (dis AND dat) vs (this AND that OR dis) AND dat vs what you'd get with no brackets. As shown, it relies on the user making sensible choices wrt operators (the AND / OR choices I would call conjunctions, not operators). The version I am working on now would be more robust in that both operators and conjunctions would be combo driven.

    Click image for larger version. 

Name:	SearchForm1.jpg 
Views:	18 
Size:	53.9 KB 
ID:	24578
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #20
    RobOtowski is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    May 2014
    Posts
    16
    Micron, Sorry I'm just now seeing what you posted for some reason I stopped being notified of replies to the thread.

    This looks great! But I've had to shelve that project for now as more pressing matters have arisen requiring my expertise (which is to say I'm the only one in the department that's ever used Access before...). Hopefully I can come back to this, I like this project better than what I have to work on. Thanks for your help.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. mydb - User-defined type not defined
    By adams77 in forum Forms
    Replies: 4
    Last Post: 07-22-2015, 08:43 AM
  2. Replies: 3
    Last Post: 11-12-2013, 04:13 PM
  3. Replies: 6
    Last Post: 09-09-2011, 10:26 AM
  4. DSum criteria using a variable that has been defined
    By beanhead0321 in forum Programming
    Replies: 5
    Last Post: 07-24-2011, 09:57 PM
  5. MakeTable Query with Variable user defined Name
    By Dinzdale40 in forum Programming
    Replies: 1
    Last Post: 03-09-2011, 11:26 AM

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
  •  
Other Forums: Microsoft Office Forums