working days

  • Thread starter victoriathomson
  • Start date
V

victoriathomson

Hi! I'm not a very advanced computer user but am trying to make
library system! I'm trying to work out how to calculate the day a boo
is due back. The books have to be returned one calendar month afte
they are taken out but if this due date falls on a weekend then the du
date is changed to a monday! can anybody help?! i'm using microsof
access 2000. I'd be very grateful if you would post a reply,
Thank you so much,
Vicki
 
S

Steve Schapel

Vicki,

See my response to your post in the .formscoding newsgroup.

Just a hint for the future... If you really feel that it is important
for your post to appear in more than one newsgroup (in practice, it
seldom is), it is much better to cross-post, i.e. address the same
message to both newsgroups, instead of sending a separate copy of the
message to both groups. Thanks.
 
F

Fred Boer

Hello:

I'm interested in any library database, since I'm working on my own.
However, I see no attachement with this post, nor does the link appear to
work...

Thanks!
Fred Boer
 
V

Victor Delgadillo

Victoria:

I would try the following simple function:

Public Function ReturnDate(LoanDate As Date) As Date
Dim NewDate As Date
NewDate = DateAdd("m", 1, LoanDate)
intWDay = Weekday(NewDate)
Select Case intWDay
Case 6 ' if its Saturday, add 2 days for next Monday
NewDate = DateAdd("d", NewDate, 2)
Case 7 ' if its Sunday, add 1 day for next Monday
NewDate = DateAdd("d", NewDate, 1)
End Select
ReturnDate = NewDate
End Function

Hope this helps.
 

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