[AccessD] Puzzling Behavior

Susan Harkins ssharkins at gmail.com
Sun Jan 6 11:00:21 CST 2008


Can a Long handle a decimal?

Susan H.


> 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