Can someone show me the correct way to change the If Then statement below to a Select Case?
Function CalcPreSpeed() 'Calculate the Pre speed using the formula (sum/57.5)*100
Dim iQ3A As Integer
Dim iQ3B As Integer
Dim iQ3C As Integer
Dim iQ3D As Integer
iQ3A = Forms!frmMain!PreQ_3A
iQ3B = Forms!frmMain!PreQ_3B
iQ3C = Forms!frmMain!PreQ_3C
iQ3D = Forms!frmMain!PreQ_3D
If iQ3A <> 6 And iQ3B <> 6 And iQ3C <> 6 And iQ3D = 6 Then
Forms!frmMain.PreSpeed = (((iQ3A * 1.5) + (iQ3B * 2) + (iQ3C * 3)) / 32.5) * 100
ElseIf iQ3A <> 6 And iQ3B <> 6 And iQ3C = 6 And iQ3D = 6 Then
Forms!frmMain.PreSpeed = (((iQ3A * 1.5) + (iQ3B * 2)) / 17.5) * 100
ElseIf iQ3A = 6 And iQ3B = 6 And iQ3C = 6 Or iQ3A = 6 And iQ3C = 6 And iQ3D = 6 Or iQ3B = 6 And iQ3C = 6 And iQ3D = 6 Then 'If 3 answers in the section are 6, do not calculate the total score for that section
Forms!frmMain.PreSpeed = 0
Else
Forms!frmMain.PreSpeed = (((iQ3A * 1.5) + (iQ3B * 2) + (iQ3C * 3) + (iQ3D * 5)) / 57.5) * 100
End If
End Function
Function CalcPreSpeed() 'Calculate the Pre speed using the formula (sum/57.5)*100
Dim iQ3A As Integer
Dim iQ3B As Integer
Dim iQ3C As Integer
Dim iQ3D As Integer
iQ3A = Forms!frmMain!PreQ_3A
iQ3B = Forms!frmMain!PreQ_3B
iQ3C = Forms!frmMain!PreQ_3C
iQ3D = Forms!frmMain!PreQ_3D
If iQ3A <> 6 And iQ3B <> 6 And iQ3C <> 6 And iQ3D = 6 Then
Forms!frmMain.PreSpeed = (((iQ3A * 1.5) + (iQ3B * 2) + (iQ3C * 3)) / 32.5) * 100
ElseIf iQ3A <> 6 And iQ3B <> 6 And iQ3C = 6 And iQ3D = 6 Then
Forms!frmMain.PreSpeed = (((iQ3A * 1.5) + (iQ3B * 2)) / 17.5) * 100
ElseIf iQ3A = 6 And iQ3B = 6 And iQ3C = 6 Or iQ3A = 6 And iQ3C = 6 And iQ3D = 6 Or iQ3B = 6 And iQ3C = 6 And iQ3D = 6 Then 'If 3 answers in the section are 6, do not calculate the total score for that section
Forms!frmMain.PreSpeed = 0
Else
Forms!frmMain.PreSpeed = (((iQ3A * 1.5) + (iQ3B * 2) + (iQ3C * 3) + (iQ3D * 5)) / 57.5) * 100
End If
End Function