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

    Switch Routine

    I have three fields from which to chose the status. Each field is ranked, just like the military.

    Fields are:
    Lowest: AO_Vote


    Middle: O6_Vote
    Highest: GO_Vote

    My intent is to display the highest status of the vote. So if the O6_Vote is given after the AO_Vote, the O6_Vote status will be displayed, then if the GO_Vote is entered, it will display that.

    I am using the current code for that control.

    Code:
    =Switch([GO_Vote]="Approved","GO Approved",[O6_Vote]="Approve","CCB Approved",[O6_Vote]="Deferred","CCB Deferred",[AO_Vote]="Deferred","AO Deferred",[AO_Vote]="Approve","AO Approved",[AO_Vote]="Deny","Denied",[AO_Vote]="Withdraw","AO Withdrawn",[O6_Vote]="Hold","CCB Hold",[AO_Vote]="Hold","AO Hold",[AO_Vote]="Open","Open")
    There are 6 possible vote statuses for AO and O6 votes
    Approve
    Denied
    Defer
    Hold
    Pending
    Withdraw
    AO_Vote Only has a 7th - Open

    GO_Vote has 6 with grammatical differences
    Approved
    Deferred
    Denied
    Hold
    Pending
    Withdrawn

    Is there an easier way to do this?

  2. #2
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    I tried putting it all in:
    Code:
    Switch([GO_Vote]="Approved","GO Approved",[GO_Vote]="Deferred","GO Deferred",[GO_Vote]="Denied","GO Denied",[GO_Vote]="Withdrawn","GO Withdrawn",[GO_Vote]="Hold","GO Hold",[GO_Vote]="Pending","GO Pending", [O6_Vote]="Approved","CCB Approved",[O6_Vote]="Deferred","CCB Deferred",[O6_Vote]="Denied","CCB Denied",[O6_Vote]="Withdrawn","O6 Withdrawn",[O6_Vote]="Hold","CCB Hold",[O6_Vote]="Pending","CCB Pending", [AO_Vote]="Approved","AO Approved",[AO_Vote]="Deferred","AO Deferred",[AO_Vote]="Denied","AO Denied",[AO_Vote]="Withdrawn","AO Withdrawn",[AO_Vote]="Hold","AO Hold",[AO_Vote]="Pending","GO Pending",[AO_Vote]="Open","Open")
    Access tells me it is too complex.

    for some of the reports I can divide levels. AO_Vote and then AO_Vote & O6_Vote then O6_Vote & GO_Vote. with the switch.
    Last edited by Thompyt; 03-27-2015 at 04:47 PM.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725

  4. #4
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Thanks, I've seen that and my code follows that example. I am looking for an alternate simpler means.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    You talk about Vote statuses and you say
    So if the O6_Vote is given after the AO_Vote, the O6_Vote status will be displayed, then if the GO_Vote is entered, it will display that.
    Can you tell us what a vote is; who votes on what etc, why multiple statuses? How this is to be used? Can you walk through an example?

  6. #6
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    You might be thinking into it too much.

    Lets clarify to the civilian side of the population.

    Vote: a formal indication of a choice between two or more candidates or courses of action, expressed typically through a ballot or a show of hands or by voice.

    AO_Vote = Senate level in government
    O6_Vote is the Vice President
    GO-Vote is the President

    Each one ranks higher (per se') and outvotes the other with the president vetoing or allowing

    Example
    AO_Vote - Votes "Approve" with the outcome of AO Approved in the status display (Status Field)
    Then
    O6_Vote - Votes "Denied" with the outcome now displaying "CCB Denied" in the status display
    Now GO_Vote - Votes _ "Approved" (ed added to Approve as the GO-Vote has the Final say in the matter) displaying "GO Approved" in the status display.

    Multiple statuses are there as there are different levels for each instance. Level 1 or Software Level 1 / Level 2 or Software Level 2 / Level 3 Cat I or Software Level 3 Cat I / Level 3 Cat II or Software Level 3 Cat II
    Level 1's require only AO_Vote Approval
    Level 2's and Level 3 Cat I require first AO_Vote, then the O6_Vote for final approval
    Level 3 Cat II require first AO_Vote approval, then the O6_Vote level, with the GO-Vote as the final level.

    If there is further information at the first 2 levels, the voting level may place a Hold, Defer, or Pending in the status. Circumstances dictate.

    Where there is dissention at one level where there is not a full Agreement or Denied the level will change to the next higher level. If at the next level has the same outcome, the GO_Vote has the final say.

    If there is full Agreement or full Denied by the voting members, and the instance is at their level (AO_Vote = Approve, Level 1 instance) then the final vote = "AO Approved" or if at (O6_Vote Level = Approve, Level 2 or Level 3 Cat I instance) the final vote = "CCB Approved" and so on.

    The changes in the Status gives the user reports/forms where at a glance they can determine where that instance is at in comparison to its onset to completion.

    Hope this helps.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Yes, I guess I'm trying too hard.
    Can you show us your tables and relationships?

    In plain English, I think you are saying(my best guess)
    -there is some sort of proposal that
    -is put before some people/group and
    -they review/discuss and assign a Status
    - if there is agreement, the proposal (and the status)
    -is sent to another group who may discuss and vote and assign/revise status
    -then it goes to final decision maker who can accept or veto any and all statuses

  8. #8
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Its convoluted, but you get the gist of it.

    This is a minimalized version with some data in it. There are no relationships, its simplified.

    Minimal.zip

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

Similar Threads

  1. incrementally slower routine -- vba
    By bill shockley in forum Access
    Replies: 2
    Last Post: 07-01-2012, 02:12 PM
  2. Replies: 3
    Last Post: 02-09-2011, 07:43 AM
  3. Contract Write Routine
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-31-2010, 05:15 AM
  4. Example Importing routine
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-24-2010, 12:35 AM
  5. applying a charge routine
    By rbrookes8dec in forum Access
    Replies: 1
    Last Post: 08-08-2010, 11:01 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