L
LAS
I'm trying to come up with a standard way to deal with the problem that some
things allow nulls and others don't, and it's taxing my brain to try to keep
them straight. I'm thinking about using variants in all my function
parameters, and dealing with them, depending on need, something like I have
below. Are there downsides to this?
Public Function fncTotalByOther(av_CodeGroup As Variant, av_Where As
Variant) As String
On Error GoTo Err_TotalByOther
fncTotalByOther = "Bad data"
If Nz(av_CodeGroup) = "" Then
MsgBox ("fncTotalByOther: Code_Group is empty")
Exit Function
End If
av_Where = Nz(av_Where,"")
things allow nulls and others don't, and it's taxing my brain to try to keep
them straight. I'm thinking about using variants in all my function
parameters, and dealing with them, depending on need, something like I have
below. Are there downsides to this?
Public Function fncTotalByOther(av_CodeGroup As Variant, av_Where As
Variant) As String
On Error GoTo Err_TotalByOther
fncTotalByOther = "Bad data"
If Nz(av_CodeGroup) = "" Then
MsgBox ("fncTotalByOther: Code_Group is empty")
Exit Function
End If
av_Where = Nz(av_Where,"")