adding 1 day to a date

S

Simon

I would like to be able to display a date which will be one day more
than what i type in, but if the date i type in is a friday i would
like it to display Mondays date

Thanks
 
K

Ken Sheridan

I assume you'd also want a weekend date to step forward to the following
Monday. Add the following function to a standard module:

Public Function NextWorkday(dtmDate As Date)

Dim dtmNextDay As Date

dtmNextDay = dtmDate + 1

Do While Weekday(dtmNextDay, vbMonday) > 5
dtmNextDay = dtmNextDay + 1
Loop

NextWorkday = dtmNextDay

End Function

In the AfterUpdate event procedure of the control put:

Dim ctrl As ctrl

Set ctrl = Me.ActiveControl
ctrl = NexWorkday(ctrl)

Ken Sheridan
Stafford, England
 
K

KARL DEWEY

Try this --
IIf(Format([myday]+1,"w") Between 2 And
6,[myday]+1,IIf(Format([myday]+2,"w") Between 2 And 6,[myday]+2,[myday]+3))
 
Top