Storyteller
Instructor
Hello All,
I am trying to create a custom function in Access to be used in a Query. The function is LN(), it does exist in Excel. Unfortunately, LN() is not available to the Access or VBA Library. Hence why I need to create a custom function.
This is what I have done so far:
Public Function LN(ByVal Q As Double)
Dim xl As Excel.Application
Dim x As Double
Set xl = New Excel.Application
x = xl.WorksheetFunction.LN(Q)
Debug.Print x
End Function
The Debug.Print x does show the proper result, but the functon does not show the result.
I would like to be able to use the function in the following manner: LN([Q]) in an Access query.
I know that the LOG() function will do almost the same thing, but not quite. That is why I need the LN() function.
Can anyone shed some light on what I am missing?
Thanks,
Michael
I am trying to create a custom function in Access to be used in a Query. The function is LN(), it does exist in Excel. Unfortunately, LN() is not available to the Access or VBA Library. Hence why I need to create a custom function.
This is what I have done so far:
Public Function LN(ByVal Q As Double)
Dim xl As Excel.Application
Dim x As Double
Set xl = New Excel.Application
x = xl.WorksheetFunction.LN(Q)
Debug.Print x
End Function
The Debug.Print x does show the proper result, but the functon does not show the result.
I would like to be able to use the function in the following manner: LN([Q]) in an Access query.
I know that the LOG() function will do almost the same thing, but not quite. That is why I need the LN() function.
Can anyone shed some light on what I am missing?
Thanks,
Michael