Daniel you need to learn how to effectively search GoogleGRoups. I have
posted this solution several times over the years and use it in several of
the sample MDB's on my site.
http://www.vbaccelerator.com/tips/vba0018.htm

Signature
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
> Does someone have such a function? Or ref a website that explain the math
> so
[quoted text clipped - 3 lines]
>
> Daniel