Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2012

    Unanswered: Parameter query problems

    In a Access 2007 DB
    I have a Parameter query with conditions on 2 fields & set those conditions to be whatever is selected in a combo box on a form (there are 2 combo boxes on this particular form). What I’m trying to achieve is a parameter search that will perform the following.

    • If ProjectDirector selected & ProjectManager not = show all results for ProjectDirector
    • If ProjectManager selected & ProjectDirector not = show all results for ProjectManager
    • If ProjectDirector & ProjectManager selected = show results for both
    • If nothing selected = msgbox “Select Project Director, Manager or both.”

    The query will provide results correct if the ProjectManager or ProjectDirector are selected individually
    The problem is if both fields are selected it only provides results as though the first field (ProjectDirector) was selected.

    The SQL for the query is :
    SELECT tblProjectInfo.JobNum, tblProjectInfo.ProjectDirector, tblProjectInfo.ProjectManager, tblProjectInfo.ProjectDescript
    FROM tblProjectInfo
    WHERE (((tblProjectInfo.ProjectDirector)=Forms!frmWhatIs Mine!Combo0 And (tblProjectInfo.ProjectManager)=Forms!frmWhatIsMin e!Combo3)) Or (((tblProjectInfo.ProjectDirector)=Forms!frmWhatIs Mine!Combo0)) Or (((tblProjectInfo.ProjectManager)=Forms!frmWhatIsM ine!Combo3));

    Thanks in advance for any help

  2. #2
    Join Date
    Apr 2004
    Derbyshire, UK
    Provided Answers: 2

    There is an inconsistance in the form name ie
    frmWhatIs Mine
    frmWhatIsMin e
    frmWhatIsM ine



  3. #3
    Join Date
    Apr 2012
    All good, is fixed now, issue was with AND OR AND statement , it needed to be a OR AND OR
    thanks anyways

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