Results 1 to 5 of 5
  1. #1
    GinaFlan is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2014
    Location
    Texas
    Posts
    68

    Need help cleaning up this Select Case statement, I'm close.

    I need help cleaning this up. I was practicing trying it myself I know I am close but need help.







    Select Case Comboyesorno
    Case "Yes"
    Select Case Me.txtBenchmarks
    Case "Revenue recorded incl. claims", "Free lunch for all students Yes/No", "Physical count conducted", "Prvide updted number of students daily rolled up monthly"
    Me.txtMetGoal = "Met Goal"
    End Select

    Case Comboyesorno
    Case "No"
    Select Case Me.txtBenchmarks
    Case "Revenue recorded incl. claims", "Free lunch for all students Yes/No", "Physical count conducted", "Prvide updted number of students daily rolled up monthly"
    Me.txtMetGoal = "Did not meet Goal"
    End Select
    Case Comboyesorno
    Case "Yes"
    Select Case Me.txtBenchmarks
    Case "No findings", "No commodities retained longer than 6 months", "No violations identified", "No major swings", "No disposals without proper recording"
    Me.txtMetGoal = "Did not meet Goal"
    End Select

    Case Comboyesorno
    Case "No"
    Select Case Me.txtBenchmarks
    Case "No findings", "No commodities retained longer than 6 months", "No violations identified", "No major swings", "No disposals without proper recording"
    Me.txtMetGoal = "Met Goal"
    End Select


    End Select

  2. #2
    GinaFlan is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2014
    Location
    Texas
    Posts
    68
    Or would it be closer to this?
    Select Case Comboyesorno
    Case "Yes"
    Select Case Me.txtBenchmarks
    Case "Revenue recorded incl. claims", "Free lunch for all students Yes/No", "Physical count conducted", "Prvide updted number of students daily rolled up monthly"
    Me.txtMetGoal = "Met Goal"
    Case "No"
    Me.txtMetGoal = "Did not meet Goal"
    End Select
    End Select


    Case Comboyesorno
    Case "Yes"
    Select Case Me.txtBenchmarks
    Case "No findings", "No commodities retained longer than 6 months", "No violations identified", "No major swings", "No disposals without proper recording"
    Me.txtMetGoal = "Did not meet Goal"
    Case "No"
    Me.txtMetGoal = "Met Goal"
    End Select
    End Select

  3. #3
    GinaFlan is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2014
    Location
    Texas
    Posts
    68
    I figured out it part of the learning process




    Select Case Me.txtBenchmarks
    Case "Revenue recorded incl. claims", "Free lunch for all students Yes/No", "Physical count conducted", "Prvide updted number of students daily rolled up monthly"
    Me.txtMetGoal = "Met Goal"
    End Select
    End Select

    Select Case Comboyesorno
    Case "No"
    Select Case Me.txtBenchmarks
    Case "Revenue recorded incl. claims", "Free lunch for all students Yes/No", "Physical count conducted", "Prvide updted number of students daily rolled up monthly"
    Me.txtMetGoal = "Did not meet Goal"
    End Select
    End Select





    Select Case Comboyesorno
    Case "Yes"
    Select Case Me.txtBenchmarks
    Case "No findings", "No commodities retained longer than 6 months", "No violations identified", "No major swings", "No disposals without proper recording"
    Me.txtMetGoal = "Did not meet Goal"
    End Select
    End Select

    Select Case Comboyesorno
    Case "No"
    Select Case Me.txtBenchmarks
    Case "No findings", "No commodities retained longer than 6 months", "No violations identified", "No major swings", "No disposals without proper recording"
    Me.txtMetGoal = "Met Goal"
    End Select
    End Select

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,522
    If there's no other choice for COMBOYESORNO then no need for SELECT statement
    (or is this just a sample?)

    (and indentation helps readability)

    Code:
    If Comboyesorno = "Yes" Then
           Select Case txtBenchmarks
                Case "No findings", "No commodities retained longer than 6 months", "No violations identified", "No major swings", "No disposals without proper recording"
                    txtMetGoal = "Did not meet Goal"
                Case "No"
                    txtMetGoal = "Met Goal"
        End Select
    End If

  5. #5
    GinaFlan is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2014
    Location
    Texas
    Posts
    68
    Ok Thank you so much

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

Similar Threads

  1. CASE STATEMENT or IF-ELSE-THEN? HELP
    By Shakenaw in forum Access
    Replies: 9
    Last Post: 06-08-2015, 11:24 AM
  2. Case Statement
    By RussH in forum Programming
    Replies: 1
    Last Post: 08-12-2013, 02:50 PM
  3. if or case statement and how
    By Dannat in forum Queries
    Replies: 1
    Last Post: 01-31-2012, 10:35 AM
  4. Help with Select Case statement
    By focosi in forum Access
    Replies: 4
    Last Post: 08-09-2011, 12:01 AM
  5. Case Statement Syntax
    By allenjasonbrown@gmail.com in forum Programming
    Replies: 1
    Last Post: 11-16-2010, 07:18 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