working days

  • Thread starter Thread starter victoriathomson
  • Start date 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
 
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.
 
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
 
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.
 
Back
Top