Compile error in query expression

  • Thread starter Thread starter Dean C.
  • Start date Start date
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.
 
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])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top