Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date in Form 1

Status
Not open for further replies.

Rjconrep

Technical User
Oct 24, 2000
66
US
I have a field where I input a date. Based on that date I want another field to add a day to the date.
 
Try this:

MyDate2 = DateAdd("d", 1, MyDate1)

Mydate1 is the input field, rename to yours.
MyDate2 is the other field, rename.

To test it put the code into the "afterupdate" event in MyDate1.
 
Now I have another dilemma. I need the field that gets updated based on the first fields value to update to the following Monday if the value in the original field is Friday.
In other words I need the program to skip weekends and default to the following Monday.
 
If Weekday(mydate1, vbSunday) = vbFriday Then
mydate2 = mydate1 + 3
Else
mydate2 = mydate1 + 1
End If
"What a wonderfull world" - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top