[AccessD] Puzzling Behavior

Max Wanadoo max.wanadoo at gmail.com
Sun Jan 6 10:59:50 CST 2008


Is the calling value (the one receiving the returned value) also a LONG?
Max
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Sunday, January 06, 2008 4:51 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Puzzling Behavior

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
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list