Compile error in query expression

D

Dean C.

Hi i am calling this function from a query using the
results of two fields as input parameters. I have started
getting error message " Compile error in query
expression 'NatBRinitial([GLH Start],[GLH End])'. " I did
not previously receive this error when running the same
query. Does anyone know why?

The function used is below:

Option Compare Database
Option Explicit

Function NatBRinitial(Fixed0203 As Variant, Rate As
Variant)
Dim NBRvar As Variant
Dim NBRback As Variant

If Fixed0203 = 0 Then
NBRback = Rate

Else:
NBRback = Fixed0203
End If

NatBRinitial = NBRback
End Function


thanks Dean C.
 
D

Douglas J. Steele

Your references could have gotten messed up by the installation of some
other software.

However, you don't really need that function anyhow. Change your query to:

NatBRinitial: IIf([GLH Start] = 0, [GLH End], [GLH Start])
 
Top