Try this (untested):
Code:
Private Sub txtCurrentYearGLLosses_AfterUpdate()
If Not IsNull(txtCurrentYearGLPremium) And Not IsNull(txtCurrentYearGLLosses) Then
' Call CalcRatio( PremiunFieldName, LossFieldName, "PutInControlName")
Call CalcRatio(txtCurrentYearGLPremium, txtCurrentYearGLLosses, "txtCurrentYearLostRatio")
End If
End Sub
Private Sub txtCurrentYearGLPremium_AfterUpdate()
If Not IsNull(txtCurrentYearGLPremium) And Not IsNull(txtCurrentYearGLLosses) Then
Call CalcRatio(txtCurrentYearGLPremium, txtCurrentYearGLLosses, "txtCurrentYearLostRatio")
End If
End Sub
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub CalcRatio(pPremium As Single, pLosses As Single, pCtrl As String)
' if code behind form
' Me(pCtrl) = pLosses / pPremium
' if code is in a standard module or control is on a different form
Forms!YourFormName.Controls(pCtrl) = pLosses / pPremium
End Sub
Change the blue "YourFormName" to your form(s) name(s).....