Just a few minutes ago I had my user form at least displaying vlaues in the labels. After I added the Dim xxx, xxx As Integer lines I do not get anything in the labels now.
Here's what I am trying to accomplish. In the 5 text boxes the user inputs a value, not all text boxes will be filled if they are not needed. Then if the check box is checked off (40% will be deducted from the value in the text box) and the result is placed in the corresponding label.
I'm sure there is an easier way to do this rather than the way I have it now. And any suggestions would be greatly appreciated.
Here is my code as it is now.
Here's what I am trying to accomplish. In the 5 text boxes the user inputs a value, not all text boxes will be filled if they are not needed. Then if the check box is checked off (40% will be deducted from the value in the text box) and the result is placed in the corresponding label.
I'm sure there is an easier way to do this rather than the way I have it now. And any suggestions would be greatly appreciated.
Here is my code as it is now.
Code:
Private Sub chkCutHalf_Click()
Dim Disc As Integer
Dim txtCutA1, txtCutA2, txtCutA3, txtCutA4, txtCutA5 As Integer
Dim lblCutA1, lblCutA2, lblCutA3, lblCutA4, lblCutA5 As Integer
Disc = 0.6
'Calculate each field and place result in 'B' field
If txtCutA1 <> 0 Then
lblCutA1 = txtCutA1 * Disc
Else
lblCutA1 = txtCutA1
End If
If txtCutA2 <> 0 Then
lblCutA2 = txtCutA2 * Disc
Else
lblCutA2 = txtCutA2
End If
If txtCutA3 <> 0 Then
lblCutA3 = txtCutA3 * Disc
Else
lblCutA3 = txtCutA3
End If
If txtCutA4 <> 0 Then
lblCutA4 = txtCutA4 * Disc
Else
lblCutA4 = txtCutA4
End If
If txtCutA5 <> 0 Then
lblCutA5 = txtCutA5 * Disc
Else
lblCutA5 = txtCutA5
End If
End Sub