Date forward 1 days from current date skipping weekend

G

Guest

I have a date field on my Form which will show the next days date like this

If Today is Monday(Jan 01,2004), then my field wil show tommorrow's date(Jan 02, 2004

and if Today is Friday(Jan 05, 2004) then my field will show Monday's date (Jan 08, 2004

Can anyone help?? thanks....
 
G

Graeme Richardson

This code does the trick:

If Weekday(MyDate, vbSunday) = vbFriday Then
MyField = DateAdd("d", 3, MyDate)
Else
MyField = DateAdd("d", 1, MyDate))
End If

Hope this helps, Graeme
 

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