Need Default date value to always be the next Friday beyond Current Date

M

Marcel K.

Can anyone offer suggestion on how to set a control with
default value to be the next Friday beyond the current
date. IF today is 2/12/2004, the default then should be
2/13/2004. If the the date is 2/14/2004, then default
date should be 2/21/2004.

Thanks in advance Marcel K.
 
W

Wayne Morgan

If the the date is 2/14/2004, then default
date should be 2/21/2004.

Just to verify, this should read 20 not 21? Also, you don't say how you want
to handle it if today is Friday. Do you still want the next Friday or do you
want today?

If today if Friday and you want the next Friday:
=Date()-Weekday(Date(),vbFriday)+8

If today is Friday and you want today:
=Date()-Weekday(Date(),vbSaturday)+7
 
M

Marshall Barton

Marcel said:
Can anyone offer suggestion on how to set a control with
default value to be the next Friday beyond the current
date. IF today is 2/12/2004, the default then should be
2/13/2004. If the the date is 2/14/2004, then default
date should be 2/21/2004.

Set the text box's DafaultValue property to:

DateAdd("d",8-DatePart("w",Date(),6),Date())
 

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