rlreynolds217
Registered User.
- Local time
- Today, 13:24
- Joined
- Oct 4, 2012
- Messages
- 11
Hello, I am trying to program a Risk Management Matrix. Once the user selects the risk from a combobox, then the probability and impact should be updated. After the probability and impact are updated (values pulled from the record associated with the combobox record), then the matrix should be updated. It is a 5x5 matrix that should be controlled by "if" statements (ex, if Probability = 3 and Impact = 4, then textbox P3_I4_matrix gets the combobox risk number).
I am having problems first updating the Probability and Impact, then secondly updating the matrix.
Here is the code to assign the P_I Matrix boxes:
Private Sub cboUpdateP_I_Click()
If Me.RiskMatrixP = 1 Then
If Me.RiskMatrixI = 1 Then
Me.P1_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P1_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P1_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P1_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P1_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 2 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P2_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P2_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P2_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P2_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P2_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 3 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P3_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P3_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P3_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P3_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P3_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 4 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P4_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P4_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P4_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P4_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P4_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 5 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P5_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P5_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P5_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P5_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P5_I5 = txtRiskforMatrix
End If
End If
End Sub
I am having problems first updating the Probability and Impact, then secondly updating the matrix.
Here is the code to assign the P_I Matrix boxes:
Private Sub cboUpdateP_I_Click()
If Me.RiskMatrixP = 1 Then
If Me.RiskMatrixI = 1 Then
Me.P1_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P1_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P1_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P1_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P1_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 2 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P2_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P2_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P2_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P2_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P2_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 3 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P3_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P3_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P3_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P3_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P3_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 4 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P4_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P4_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P4_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P4_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P4_I5 = txtRiskforMatrix
End If
ElseIf Me.RiskMatrixP.Value = 5 Then
If Me.RiskMatrixI.Value = 1 Then
Me.P5_I1 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 2 Then
Me.P5_I2 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 3 Then
Me.P5_I3 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 4 Then
Me.P5_I4 = txtRiskforMatrix
ElseIf Me.RiskMatrixI.Value = 5 Then
Me.P5_I5 = txtRiskforMatrix
End If
End If
End Sub