Results 1 to 2 of 2
  1. #1
    AmanKaur123 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2017
    Posts
    47

    Change in query to Populate Yes,No and NA options in the listbox

    Hi All

    This is my query which works fine so when the AgentSignOff=true
    then it displays 'Yes' otherwise 'No' . So this way for all the records
    AgentSignOff gets populated with "Yes" or "No".
    but I just want to amend it
    so that it should check if the record is present in tbl_RMS_Paperless then


    checks the following : AgentSignOff=true then it displays 'Yes' otherwise
    'No'.

    If the record is not present in tbl_RMS_Paperless but it is present
    in tblAudit then populate AgentSignOff=NA for those
    records.

    Code:
    SELECT tblAudit.AuditID, tblAudit.[Staff Number], 
    tblAudit.[Date of Observation], tblCallType.[Call Type], 
    tblAuditPurpose.Purpose, tblObjective.Objective, tblOutcome.Outcome, 
    IIf([AgentSignOff]=True,"Yes","No") AS Expr1, IIf([SupSignOff]=True,"Yes","No") 
    AS Expr2
    FROM tbl_RMS_Paperless RIGHT JOIN (tblOutcome INNER JOIN 
    (tblObjective INNER JOIN (tblAuditPurpose INNER JOIN (tblCallType INNER JOIN 
    tblAudit ON tblCallType.[Call TypeID] = tblAudit.[Call TypeID]) ON 
    tblAuditPurpose.[Audit PurposeID] = tblAudit.[Audit PurposeID]) ON 
    tblObjective.ObjectiveID = tblAudit.ObjectiveID) ON tblOutcome.OutcomeID = 
    tblAudit.OutcomeID) ON tbl_RMS_Paperless.ActivityRef = tblAudit.AuditID
    WHERE 
    (((tblAudit.[Staff Number])=[cbomoveto]))
    ORDER BY tblAudit.[Date of 
    Observation] DESC , tblAudit.AuditID DESC;
    The listbox rowsource is set with the query finally as below:
    Code:
    me.lstdata.rowsource=strsql
    Any help will be much appreciated.

    Many Thanks

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    cross posted and answered here

    https://www.access-programmers.co.uk...d.php?t=293582

    @Aman - please read this link http://www.excelguru.ca/content.php?184

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

Similar Threads

  1. Populate ListBox from Table(s)
    By Brightspark98 in forum Forms
    Replies: 2
    Last Post: 02-09-2017, 09:38 AM
  2. Replies: 13
    Last Post: 09-10-2015, 03:37 PM
  3. Using a Listbox to populate a Textbox.
    By IncidentalProgrammer in forum Forms
    Replies: 7
    Last Post: 10-29-2014, 12:32 PM
  4. Replies: 1
    Last Post: 08-11-2014, 09:57 AM
  5. Replies: 10
    Last Post: 06-18-2013, 02:00 PM

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