I would like to use the Natural Log function in Access but have been unable to determine how to implement it. Can anyone provide details on how to use it?
mgr,
If you mean the LN() function as in Excel, just add the Excel library to the references and you're there. Use the Tools menu, click References, look in the list for MS Excel 8 or 9 object library, check that box, and you should have use of all Excel functions.
--Jim
Thanks for your help. I'm presently running Access 97. I found Reference under Tools once I selected Modules and opened the Utility Functions and then I selected Excel Object Library. I still can't access the LN() function when I use the expression builder. I thought it would show up under the math function. Can you provide further assistance?
Thanks,
Mike
Peter,
Thanks for your help but I'm not sure how to implement the conversion when building an expression in Access.
Here is one way to access this function in a module:
Dim x As Excel.Application, sngA As Single
Set x = New Excel.Application
sngA = x.ln(45)
I don't think it's available in the Expression builder, but you can use it in modules, or you could create a module-level Excel object, set it, then create a function
In the Declarations Section:
Dim XL as Excel.Application
Sometime at startup, call this function in the same module:
Function SetXl()
Set XL = new Excel.Application
End Function
Now this function is available in queries, expressions:
Function MyLN(dblInput) as Double
MyLn = XL.LN(dblInput)
Exit Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.