D
Derek Wittman
Good afternoon,
I have a function that I'm calling in a query's calculated field. The
function is:
why(changed, e1, e2).
There are times when e1 or e2 is null. How can I edit my function code to
negate the #Error I get when e1 or e2 is null? It is important that I keep
e1 or e2 null (depending on the record) since that's what this code is all
about.
Here's my small code:
Function why(changed As String, e1 As Double, e2 As Double) As String
If changed = "YES" And (Not e1) And e2 Then why = "Added"
If changed = "YES" And e1 And (Not e2) Then why = "Deleted"
If changed = "YES" And e1 And e2 And (e1 <> e2) Then why = "Modified"
If changed = "NO" Then why = ""
End Function
Any help would be greatly appreciated!
Derek
I have a function that I'm calling in a query's calculated field. The
function is:
why(changed, e1, e2).
There are times when e1 or e2 is null. How can I edit my function code to
negate the #Error I get when e1 or e2 is null? It is important that I keep
e1 or e2 null (depending on the record) since that's what this code is all
about.
Here's my small code:
Function why(changed As String, e1 As Double, e2 As Double) As String
If changed = "YES" And (Not e1) And e2 Then why = "Added"
If changed = "YES" And e1 And (Not e2) Then why = "Deleted"
If changed = "YES" And e1 And e2 And (e1 <> e2) Then why = "Modified"
If changed = "NO" Then why = ""
End Function
Any help would be greatly appreciated!
Derek