Trouble with "Working Days" Module

G

Guest

Hi, my problem is that when I try to use the working days function from here:
http://www.mvps.org/access/datetime/date0006.htm, I get an error message.
The error message is "Undefined Function 'Working Days' in Expression". I'm
running Access 2002. Any help would be appreciated.

Here are the steps I've taken to get to this point:
1. Created a new Access database.
2. Created a new table, called tblWorkingDays, and added 2 fields, StartDate
and EndDate. I used the date/time format for these fields. I then entered
some dates into each of the fields.
3. Created a new module and copied the code for the first function,
WorkingDays, from here: http://www.mvps.org/access/datetime/date0006.htm,
into it. Saved the module as WorkingDays.
4. Created a new query using tblWorkingDays. Added the StartDate and
EndDate fields to the query.
5. In the third column in the query design view, I added this: NoOfDays:
WorkingDays([StartDate],[EndDate]).
6. Tried to run the query. The Undefined Function 'WorkingDays' in
Expression error message is returned.

Has anyone else run into this? Thanks in advance for any help.
 
D

Duane Hookom

Don't save your module with the same name as a function or sub. Find and use
a naming convention that dictates the name of your module to something like:
basUtilityFunctions or modDateCalcs.
Also, your error suggests a space between Working and Days. I assume this is
a typo.
 
G

Guest

Thanks! Changing the name of the module fixed it.


Duane Hookom said:
Don't save your module with the same name as a function or sub. Find and use
a naming convention that dictates the name of your module to something like:
basUtilityFunctions or modDateCalcs.
Also, your error suggests a space between Working and Days. I assume this is
a typo.

--
Duane Hookom
MS Access MVP


DB said:
Hi, my problem is that when I try to use the working days function from
here:
http://www.mvps.org/access/datetime/date0006.htm, I get an error message.
The error message is "Undefined Function 'Working Days' in Expression".
I'm
running Access 2002. Any help would be appreciated.

Here are the steps I've taken to get to this point:
1. Created a new Access database.
2. Created a new table, called tblWorkingDays, and added 2 fields,
StartDate
and EndDate. I used the date/time format for these fields. I then
entered
some dates into each of the fields.
3. Created a new module and copied the code for the first function,
WorkingDays, from here: http://www.mvps.org/access/datetime/date0006.htm,
into it. Saved the module as WorkingDays.
4. Created a new query using tblWorkingDays. Added the StartDate and
EndDate fields to the query.
5. In the third column in the query design view, I added this: NoOfDays:
WorkingDays([StartDate],[EndDate]).
6. Tried to run the query. The Undefined Function 'WorkingDays' in
Expression error message is returned.

Has anyone else run into this? Thanks in advance for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top