Results 1 to 3 of 3
  1. #1
    noaccessguru is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Melbourne, Australia
    Posts
    68

    Combo Boxes Query Criteria help


    Hi guys,I am having a mental blank on how to do the criteria in my query for Combo Boxes. This is a database built by someone else but I need to change the criteria as it currently doesn’t do anything if you select a Site.I have 2 combo boxes Combo14 (Supplier) and Combo16 (Site) and I need the query to run when either scenario is selected. I can get it to work if they select a Supplier and a Site but it wont work if they choose just the ‘Supplier’, it brings back no records.I know I have to do the next line of criteria (OR) but It doesn’t work every time I try it…..Can someone please help me out and maybe point out what Im doing wrong or what I need to write?I have copied the SQL for the query, but I don’t know how to write SQL so I am do it in Design View.This is the criteria that works if they select Supplier and Site, I just dont know what I need to add if they just choose 'Supplier'
    Code:
     SELECT [CIR Component Query].[qryOranisation with parent orgs].dbo_tblExternalOrg_1.OrganisationName, [CIR Component Query].CIRID, [CIR Component Query].LocationName, [CIR Component Query].definiton, [CIR Component Query].SPParmName, [CIR Component Query].IssueDetail, [CIR Component Query].RaisedByPerson, [CIR Component Query].WorkAreaDescription, [CIR Component Query].ContactPerson, [CIR Component Query].IssuePriorityDesc, [CIR Component Query].dbo_tblExternalOrg.OrganisationName, [CIR Component Query].FaultTypeID, [CIR Component Query].FaultTypeExtraText, [CIR Component Query].CauseDetail, [CIR Component Query].ActionDetail, [CIR Component Query].ProgressComments, [CIR Component Query].IssueDateFROM [CIR Component Query]WHERE ((([CIR Component Query].[qryOranisation with parent orgs].dbo_tblExternalOrg_1.OrganisationName)=[Forms]![Switchboard]![Combo14]) AND (([CIR Component Query].LocationName)=[Forms]![Switchboard]![Combo16]) AND (([CIR Component Query].SPParmName)="Critical Defect" Or ([CIR Component Query].SPParmName)="Major Defect" Or ([CIR Component Query].SPParmName)="Minor Defect" Or ([CIR Component Query].SPParmName)="Delivery IFOT" Or ([CIR Component Query].SPParmName)="CIR Response") AND (([CIR Component Query].IssueDate) Between [Forms]![Switchboard]![Calendar2] And [Forms]![Switchboard]![Calendar3]) AND (([CIR Component Query].Region)="BCSN"))ORDER BY [CIR Component Query].[qryOranisation with parent orgs].dbo_tblExternalOrg_1.OrganisationName DESC , [CIR Component Query].IssueDate;
    Hope this makes sense and someone can show me what Im doing wrong?!Thanks in advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    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
    noaccessguru is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Melbourne, Australia
    Posts
    68
    Thanks very much June7....I didnt even think of doing the Like Statement. AS I said, was having a mental blank today!This worked putting Like and the wildcard in the criteria!Thanks heaps

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Combo Box for Query CRITERIA?
    By TUPJK in forum Queries
    Replies: 5
    Last Post: 06-04-2014, 10:43 AM
  3. SubForm with query conditional combo boxes
    By ThebigCt in forum Forms
    Replies: 1
    Last Post: 02-28-2012, 05:13 PM
  4. Running a query based on 2 combo boxes.
    By blessoni in forum Queries
    Replies: 4
    Last Post: 12-12-2010, 02:09 PM
  5. Using Cascading Combo Boxes to Filter a Query
    By skiptotheend in forum Queries
    Replies: 0
    Last Post: 10-13-2009, 06:57 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