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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set dates

Status
Not open for further replies.

5556

Programmer
May 27, 2003
17
0
0
US
on my form i have six microsoft date and time picker controls. On the form load I want one to contain the current date and the rest to add one day to the one before it so all the controls display a different date.
I know debug.print date() prints the date and adding and subtracting from this gives you different days, but i dont know how to connect this code to the date and time picker control upon the form load.
 
In the OnLoad event procedure of the Form put the following code:
[COLOR=blue
Me.DPControl1 = Date()
Me.DPcontrol2 = DateAdd("d", 1, Date())
Me.DPcontrol3 = DateAdd("d", 2, Date())
Me.DPcontrol4 = DateAdd("d", 3, Date())
Me.DPcontrol5 = DateAdd("d", 4, Date())
Me.DPcontrol6 = DateAdd("d", 5, Date())[COLOR=black]

This should do it for you.




Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top