[AccessD] Puzzling Behavior

David Emerson newsgrps at dalyn.co.nz
Sun Jan 6 11:00:15 CST 2008


Arthur,

You have set Function GSTRate as Long - it is returning a number with 
no decimals.  Try Single.

Regards

David

At 7/01/2008, you wrote:
>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