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

Reset the system clock 1

Status
Not open for further replies.

rgbanse

MIS
Jun 4, 2001
211
US
We have some jobs that are Date Dependent when pulling data. I the report runs a day late - Bad data. We can reset the computers system date to yesterday - hopefully remember to reset it. Is there some VB that can change the system date to a date other than today and reset to today when done?
thx.
RGB
 
An API call isn't needed. Here you go.

Put this in a Form Module under a button click event.

Call SetDate(#1/1/2001#)

Put this in a Database Module

Public Sub SetDate(NewDate As Variant)

On Error Resume Next

DateTime.Date = NewDate

End Sub

 
This code will work for the time:


Public Sub SetTime(NewTime As Variant)

On Error Resume Next

DateTime.Time = NewTime

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top