I have the following code in a cmdUpdate_Click event.
Is there any way to simplify the code. I suspect there is.
Is there any way to simplify the code. I suspect there is.
VBA Code:
With Me
' NNN.
If .opt4Yes.Value = False And .opt6Yes.Value = False And .opt8Yes.Value = False Then
.Fra4.Height = 38
.Fra6.Top = 44
.Fra6.Height = 38
.Fra8.Top = 82
.Fra8.Height = 38
' YYY.
ElseIf .opt4Yes.Value = True And .opt6Yes.Value = True And .opt8Yes.Value = True Then
.Fra4.Height = 174
.Fra6.Top = 180
.Fra6.Height = 174
.Fra8.Top = 354
.Fra8.Height = 216
' YYN.
ElseIf .opt4Yes.Value = True And .opt6Yes.Value = True And .opt8Yes.Value = False Then
.Fra4.Height = 174
.Fra6.Top = 180
.Fra6.Height = 174
.Fra8.Top = 354
.Fra8.Height = 38
' NYY.
ElseIf .opt4Yes.Value = False And .opt6Yes.Value = True And .opt8Yes.Value = True Then
.Fra4.Height = 38
.Fra6.Top = 44
.Fra6.Height = 174
.Fra8.Top = 218
.Fra8.Height = 216
' YNY.
ElseIf .opt4Yes.Value = True And .opt6Yes.Value = False And .opt8Yes.Value = True Then
.Fra4.Height = 174
.Fra6.Top = 180
.Fra6.Height = 38
.Fra8.Top = 218
.Fra8.Height = 216
' NYN.
ElseIf .opt4Yes.Value = False And .opt6Yes.Value = True And .opt8Yes.Value = False Then
.Fra4.Height = 38
.Fra6.Top = 44
.Fra6.Height = 174
.Fra8.Top = 218
.Fra8.Height = 38
' YNN.
ElseIf .opt4Yes.Value = True And .opt6Yes.Value = False And .opt8Yes.Value = False Then
.Fra4.Height = 174
.Fra6.Top = 180
.Fra6.Height = 38
.Fra8.Top = 218
.Fra8.Height = 38
' NNY.
ElseIf .opt4Yes.Value = False And .opt6Yes.Value = False And .opt8Yes.Value = True Then
.Fra4.Height = 38
.Fra6.Top = 44
.Fra6.Height = 38
.Fra8.Top = 82
.Fra8.Height = 216
End If
If .opt4No.Value = True Then
.txt12.Value = "NA"
.txt13.Value = "NA"
.txt14.Value = "NA"
Else
.txt12.Value = vbNullString
.txt13.Value = vbNullString
.txt14.Value = vbNullString
End If
If .opt6No.Value = True Then
.txt18.Value = "NA"
.txt19.Value = "NA"
.txt20.Value = "NA"
Else
.txt18.Value = vbNullString
.txt19.Value = vbNullString
.txt20.Value = vbNullString
End If
If .opt8No.Value = True Then
.cbo5.Value = "NA"
.txt24.Value = "NA"
.txt25.Value = "NA"
.txt26.Value = "NA"
Else
.cbo5.Value = vbNullString
.txt24.Value = vbNullString
.txt25.Value = vbNullString
.txt26.Value = vbNullString
End If
End With
End Sub