Попытка указать в текстовом поле с меткой txtPercentage
% разницы между двумя значениями текстового поля txtCurrentHourly
и txtNewHourlyRate
. Почему мой txtPercentage
не заполняет значение при срабатывании других объектов?
Private Sub txtNewHourly_Change()
Dim a As Double, b As Double
Dim txtpercent, c
a = txtCurrentHourly.Value
b = txtNewHourlyRate.Value
txtpercent = (b - a) / a
If Me.cmbHourlyAnnual.Value = "Hourly" Then
If b <> 0 Then
txtpercent
End If
ElseIf Me.cmbHourlyAnnual.Value = "Annual" Then
If b <> 0 Then
txtpercent
End If
End If
txtPercentage.Value = IIf(IsError(txtpercent), "-", txtpercent)
End Sub