Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

business day calculation

Status
Not open for further replies.

rkep

Programmer
Apr 26, 2007
7
0
0
US
i am not super savey with the coding, i have seen several faqs (michelred) for business day calc's, all functions. what i have is a form with the ms calendar option, when the user selects a date from the calendar i need to add 15 business days to it. will the faqs code work for something like that and if so, how do i call the function against the form data.
 
This might help you. Instead of msgbox you can assign it to a variable and use it.
Code:
msgbox (DateAdd("d",15,DTPicker1.Value))
 
thanks for that info but its not doing business days. moving out 15 i was able to do, its the business days portion i dont understand.
 
what about the faq do you not understand? I think it includes the necessary and sufficient directions.




MichaelRed


 
rkep,
Have you created the table of holidays as suggested/required in MichaelRed's FAQ?

You would also need to create a new module and paste his function into it. Save the module with a name like [blue]modDateFunctions[/blue]. You might also need to set a reference to the Microsoft DAO object library if there isn't one already set. You should be able to determine this by compiling the code.

Duane
Hook'D on Access
MS Access MVP
 
i created the holiday table as suggested, i then made a module and added your code into that, i then made a table to store the start and end dates from my form. i then tried to use the docmd feature to start the module after all of my data was collected. but all it does is open the module. what is needed to get the module to go through the data table and calculate the business days? thanks
 
Docmd"? You use the new function like you would use any other function. If you want to run the function against multiple records, you would generally put the function in a calculated column in a query. If you can't figure this out, come back with information about your "table to store the start and end dates".

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top