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

  • Thread starter Thread starter Marcel K.
  • Start date Start 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.
 
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
 
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())
 
Back
Top