While the offered soloution will generally work, I would almost never do it this way. Unless you are VERY careful re controls navigation, you WILL get an error from this.
In BOTH Field1 AND Field2 AfterUpdate events, call the (General) procedure basCalcField3()
Private Function basCalcField3
[tab]If (Me.Field1 = "" Then
[tab][tab]Exit Function
[tab]End If
[tab]If (Me.Field2 = "" Then
[tab][tab]Exit Function
[tab]End If
[tab]If (Val(Me.Field1) = 0) Then
[tab][tab]Exit Function
[tab]End If
[tab]'Do other / Additional Checks on the two Source fields'
[tab]'such as range (Field1 > NN) and (Field1 < NNN)
[tab]'Here ONLY if both fields pass ALL checks
[tab]Field3 = field1/field2
End Function
MichaelRed
redmsp@erols.com
There is never time to do it right but there is always time to do it over
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.