Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Another control affecting the output of a control

    In a report Final_Vote control I am trying to state If the control O6_Vote = Hold, then no matter what is in the AO_Vote it equals "Hold"

    =IIf([O6_Vote]="Hold",[AO_Vote]="Hold",[AO_Vote]) And IIf([AO_Vote]="Defer","Deferred",IIf([AO_Vote]="Approve","Approved",IIf([AO_Vote]="Deny","Denied",IIf([AO_Vote]="Withdraw","Withdrawn",[AO_Vote]))))



    In this code I end up with a 0 in the affected field with others = -1

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Try:

    =Switch([O6_Vote]="Hold", "Hold", [AO_Vote]="Defer", "Deferred", [AO_Vote]="Approve", "Approved", [AO_Vote]="Deny", "Denied", [AO_Vote]="Withdraw", "Withdrawn")
    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
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Thanks June Thats a lot cleaner than mine. Works like a charm except for the rows following where O6_Vote =Hold, then control is blank. Do you need an If then where O6_Vote is blank or <> "Hold"?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Should not. If O6_Vote is null, the expression is False and the other items will process.

    Why are there two fields? Why isn't Hold just another value under AO_Vote?

    Post example data.
    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.

  5. #5
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    There are 3 levels of voting going on. Sequentially 1. AORB 2. CCB 3. GO level. You have to have an answer on AORB to get to CCB, then answer on CCB to get to GO level. But the levels are predetermined earlier by the severity of risk. If AORB says approved, then CCB could say they need more info, and can put it on hold. I do not want to change the AORB vote per se to reflect it on the report, and then there will be a timestamp (date) for each level of vote for statistical counts. Number of days at each level. Thus in the report count, I need the current levels vote to be displayed.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Example data?
    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.

  7. #7
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    AORB.....CMB.....GO.....Final
    Approve......................Approve Level 1
    Deny......Deny.............Denied.....Level 2
    Approve..Hold..............Open.......Level 2

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Not seeing the field names from the original post. Why does one field use "Denied" instead of "Deny"?

    First record has only 3 values.
    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.

  9. #9
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    AO_Vote.......O6_Vote….....GO_Vote…......Final_Vot e……Level
    Approve........................................... .......Approved…… Level 1
    Deny.............Denied………………….............Denied… ........Level 2
    Approve……...Hold……………………..............Open........ .....Level 2

    Approve……Approve…...Approved…...Approved……Level 3

    Level 1 Approval Authority – AO_Vote
    Level 2 Approval Authority – O6-Vote
    Level 3 Approval Authority – GO_Vote

    Level 1: AO_Vote - Approves………..Final_Vote - Past tense outcome
    Level 2: AO_Vote - Recommends, O6_Vote - Approves, Final_Vote - Past tense outcome
    Level 3: AO_Vote - Recommends, O6_Vote - Recommends,GO_Vote - Approves, Final_Vote – Past tense outcome
    Last edited by Thompyt; 01-16-2015 at 12:23 PM. Reason: Formatting

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    I calculated the Final_Vote in query and in textbox and both return the results shown in the example for Final_Vote except for the second Level 2 record. Why does it show Open?
    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.

  11. #11
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Open is a case where there has been no final conclusion, the item is still open. I use it as a filter in the queries/reports.


    Example of what I get. Notice the 2 Hold in ther Open section. The following are also in Hold status, yet don't display.
    Click image for larger version. 

Name:	SITREP.jpg 
Views:	5 
Size:	273.2 KB 
ID:	19360

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    The rule you gave in OP said if 06_Vote is Hold then return Hold no matter what is in the AO_Vote. That's what my suggested expression does.

    There is another rule to consider in the calc?
    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.

  13. #13
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    No other rule right now. I was wondering why it did not make CR72-75 Hold as well.
    If O6 is hold then it should output Hold in the open section even though in the dB it is another value - approve/deny/pending/hold.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Without analyzing actual data, I have no idea.
    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.

  15. #15
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

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

Similar Threads

  1. Replies: 8
    Last Post: 06-19-2015, 02:19 AM
  2. Replies: 2
    Last Post: 11-27-2014, 01:06 PM
  3. Replies: 13
    Last Post: 07-09-2013, 07:05 PM
  4. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  5. Replies: 6
    Last Post: 03-14-2011, 09:37 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