Where do I define a user-defined VBA functions so that I can call them in the query?
Here is the problem. I am defining a VBA functions called DateDiffW which calculates the number of weekdays (i.e. excludes sat and sun) between 2 dates.
In access 2007, under the "create" tab I clicked "macro" -> "module". Then I defined the function there, starting with:
Function DateDiffW(BegDate, EndDate)
I then saved the module.
In the query, when I call the DateDiffW function I get the error:
"Undefined Function 'DateDiffW' in expression"
What am I doing wrong?