[AccessD] Puzzling Behavior

Arthur Fuller fuller.artful at gmail.com
Sun Jan 6 10:51:26 CST 2008


Maybe I'm just having a senior moment, but I can't figure out why I'm
getting the results I am. This is a really simple task. I have a system
parameters table containing two tax rate fields, GST and PST, whose values
are .05 and .08 respectively. I wrote a pair of wrapper functions to return
these values:

Function GSTRate() As Long
    GSTRate = DLookup("GST", "Company")
End Function

The function should return 0.05 but instead it returns zero. In the
immediate window, if I type this:

? Dlookup("GST", "Company")
I get back 0.05

Why doesn't the function return the same value? I even tried multiplying it
by 100, but it still gives me zero. What am I doing wrong?

TIA,
Arthur



More information about the AccessD mailing list