Results 1 to 3 of 3
  1. #1
    Deutz is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    51

    Report builder form with AND and OR


    Hi and thanks in advance,

    I am using Access 2003

    I'm building a form that enables you to specify criteria that translates into an SQL on which a report will be based.

    I have a number of combo boxes that are all filled with field names from a table and each combo box has an adjacent text box to enter criteria for the field chosen and you can also specify the operator in another combo.

    I want to allow the user to be able to AND or OR the conditions together but I'm not sure how to set it us so that it is not too complicated for the user to understand and for me to code. Rules around bracketing the conditions in the SQL seem to be quite complex. Does anyone have suggestions on how to set something like this up?


    thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    This is very difficult because correct parenthesizing is critical when mixing OR and AND operators. Just having user click AND or OR button between criteria is sure to result in a lot of frustration. Access can't know "this AND this OR this" was really intended to be "this AND (this OR this)". You can give the user buttons for each paren and hopefully they understand logical operators well enough to know when to choose them. And if they forget the closing paren - how will you deal with that?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Deutz is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    51
    Thanks June7

    That was what I was afraid of. When I started to muck around with bracketing the conditions in code, I could see the complexity involved but thought perhaps there was a simple solution I had not considered. Maybe I should just limit the user to either AND-ing all conditions or OR-ing all conditions.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 06-28-2013, 12:15 PM
  2. Need help with builder formula
    By shantmov in forum Access
    Replies: 2
    Last Post: 11-11-2012, 04:09 AM
  3. Report - Expression Builder
    By AndreasPanayiotou in forum Reports
    Replies: 3
    Last Post: 09-16-2012, 01:10 AM
  4. report builder
    By slimjen in forum Reports
    Replies: 8
    Last Post: 04-23-2012, 05:30 PM
  5. Expression builder
    By PJ_d_DJ in forum Access
    Replies: 2
    Last Post: 02-24-2011, 03:38 AM

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