VBA and queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that shows, among other things, 2 dates, a beginning date and
an end date. My goal is to calculate the number of working days. I do have
VBA code that is supposed to calcualte this. However, I don't seem to be able
to call this function from within a query. How do I do this?

Sorry if this is a dumb question.

mike
 
Put the function in a regular module (Modules from database window). Name
the module a different name from the function name. Make sure the function
is Public. Then you should be able to have your query call it.
 
Bingo!!

I didn't know that the module and the function must have different names.

Thanks.
 

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

Back
Top