Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    11

    Unanswered: CODE FOR OPTIONS by MS ACCESS

    how I make code for these OPTION

    That is evaluation for employees , I like 10 optiongroups and I will select one option from each group then I get the result total value in one text .

    Example when I have 3optiongroup and each group has 4 options

    I like to
    select Option2 from group1 + select Option3 from group2+ select Option1 from group3 = value come in Textbox

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    wut?

  3. #3
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    in the after update event of each group/ the form current event, you will have to crate a procedure to check the value of each group, add up the total of each group, and display this total in the text box.

    Private sub sbAddGroups()
    dim dblTotal as Double

    dblTotal=0
    Select Case Group1
    Case 1
    dblTotal=dblTotal+ Value
    'will need to be done for each option in group
    End Select
    ' will need to be done for each group on form

    Text1=dblTotal
    End Sub

  4. #4
    Join Date
    Mar 2004
    Posts
    11
    thank you so much dear Saila

    I make this code


    Private Sub sbAddGroups()
    Dim dblTotal As Double

    dblTotal = 0
    Select Case Frame1
    Case 1
    dblTotal = dblTotal + Value
    'will need to be done for each option in group
    Select Case Frame2
    Case 1
    dblTotal = dblTotal + Value
    End Select
    ' will need to be done for each group on form
    Select Case Frame3
    Case 1
    dblTotal = dblTotal + Value
    T1 = dblTotal
    End Sub

    ----------------------------------------------------------------

    but still the total value not come in Textbox

    your message>>>((in the after update event of each group/ the form current event,))

    what is the code for update event and cuttent event?

  5. #5
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    Code:
    Private Sub sbAddGroups()
    Dim dblTotal As Double
    
        dblTotal = 0
    
        Select Case Frame1
            Case 1
                dblTotal = dblTotal + Value1
            Case 2
                dblTotal = dblTotal + Value2
            Case 3
                ' repeat for each option in frame 1
        End Select
        
        Select Case Frame2
            Case 1
                dblTotal = dblTotal + Value1
            Case 2
                dblTotal = dblTotal + Value2
            Case 3
                ' repeat for each option in frame 1
        End Select
        
        Select Case Frame3  'Repeat for each Frame.
        
        'Change ValueX to correct value.
        T1 = dblTotal
    End Sub
    
    After_Update
        sbAddGroups
    You can either add the sbAddGroups line to each After_Update event, or just to the Form_Current event.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •