Private Sub label45_click()
Dim a, b, c, d, r As Integer
a = Val(Text49.Text)
b = Val(Text50.Text)
c = Val(Text51.Text)
d = Val(Text52.Text)
'r = a + b + c + d
txtTotalCost.Text = r
'Check which textbox is selected to perform sum
If Text49.Enabled = True Then
r = a
txtTotatlCost.Text = r
Else
If Text49.Enabled = True And Text50.Enabled = True Then
r = a + b
txtTotalCost.Text = r
ElseIf Text49.Enabled = True And Text50.Enabled = True And Text51.Enabled = True Then
r = a + b + c
txtTotalCost.Text = r
ElseIf Text49.Enabled = True And Text50.Enabled = True And Text51.Enabled = True And Text52.Enabled = True Then
r = a + b + c + d
txtTotalCost.Text = r
End If
End If
End Sub
I would like some advise that could resolve this.

New Topic/Question
Reply



MultiQuote







|