murfeezlaw
New member
- Local time
- Today, 05:04
- Joined
- Dec 5, 2006
- Messages
- 7
Hi all, i'm not the strongest of VBA programmers. I know there has to be an easier way to do this. I have a Loss Ratio field being calculated if the Loss field or Premium field is updated. I have 18 Loss Ratio fields that are going to be calculated so 36 event procedures. I know that's a waste of code. I think i might be able to use my code w an Argument but i'm not sure how to do that. Any help would be very much appreciated.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub txtCurrentYearGLLosses_AfterUpdate()
If Not IsNull(txtCurrentYearGLPremium) And Not IsNull(txtCurrentYearGLLosses) Then
txtCurrentYearLostRatio = txtCurrentYearGLLosses / txtCurrentYearGLPremium
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub txtCurrentYearGLPremium_AfterUpdate()
If Not IsNull(txtCurrentYearGLPremium) And Not IsNull(txtCurrentYearGLLosses) Then
txtCurrentYearLostRatio = txtCurrentYearGLLosses / txtCurrentYearGLPremium
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub txtCurrentYearGLLosses_AfterUpdate()
If Not IsNull(txtCurrentYearGLPremium) And Not IsNull(txtCurrentYearGLLosses) Then
txtCurrentYearLostRatio = txtCurrentYearGLLosses / txtCurrentYearGLPremium
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Private Sub txtCurrentYearGLPremium_AfterUpdate()
If Not IsNull(txtCurrentYearGLPremium) And Not IsNull(txtCurrentYearGLLosses) Then
txtCurrentYearLostRatio = txtCurrentYearGLLosses / txtCurrentYearGLPremium
End If
End Sub
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~