I have another question regarding reducing duplication in code. I have the following involving a number of toggle buttons. Is there a way to condense it?
Thank you again...
Thank you again...
VBA Code:
Private Sub tog1_Click()
Dim i As Integer
With Me
If .tog1.Value = True Then
.tog1.BackColor = vbGreen
For i = 12 To 14
Controls("txt" & i).Value = vbNullString
Controls("txt" & i).Enabled = True
Next i
Else
.tog1.BackColor = vbRed
For i = 12 To 14
Controls("txt" & i).Value = "NA"
Controls("txt" & i).Enabled = False
Next i
End If
End With
End Sub