Creating a form that needs to do some calculations. I am trying to get the code to take the value from one text field and divide it by the other text field and set my total field equal to the value of the calculation. Here is the code that I created when I click on the Calculate button I created I get this message : "You can't reference a property or a method for a control unless the control has the focus"
My Code:
Private Sub btnCalculate_Click()
On Error GoTo Err_btnCalculate_Click
'Calculates Full-Time Equivalent
Me.txtFTE.Text = Me.txtHours.Value / Me.txtWorkWeek.Value
Exit_btnCalculate_Click:
Exit Sub
Err_btnCalculate_Click:
MsgBox Err.Description
Resume Exit_btnCalculate_Click
End Sub
Thanks in advance for any help!
My Code:
Private Sub btnCalculate_Click()
On Error GoTo Err_btnCalculate_Click
'Calculates Full-Time Equivalent
Me.txtFTE.Text = Me.txtHours.Value / Me.txtWorkWeek.Value
Exit_btnCalculate_Click:
Exit Sub
Err_btnCalculate_Click:
MsgBox Err.Description
Resume Exit_btnCalculate_Click
End Sub
Thanks in advance for any help!