Hi Dan

I created an add-in for Access some time ago that gives you access to the Excel trig functions via VBA. You can download the dll file from here:

http://www.accessdata.co.nz/samples.htm

This only works with VBA but you can use it to create your own trig functions, like this:

Then you can use the 'Degrees' function in a query, like so :Code:Public Function Degrees(InputVal As Double) As Double Dim ATF As XLTrigFuncs.XLFunctions Set ATF = New XLTrigFuncs.XLFunctions Degrees = ATF.AngleDegrees(InputVal) Set ATF = Nothing End Function

Degrees(MyNumber)

There are 13 different trig functions you can call on - as you type the "ATF." part you should then see a list pop up of the available trig functions. You will need to create a separate function for each function you want to use much like the example I provided. You could also expand the function to check for errors (null strings, bad values etc) before passing the value into the function to avoid any unexpected errors.

Given this dll calls on the Excel equivalent functions, it isn't the speediest method but it works. There are also some instructions on the webpage for registering the dll file.

Just post back if you get stuck.

HTH, Andrew

## Like this thread? Share it with others