time and data in access code?

uniboy

Registered User.
Local time
Today, 23:45
Joined
Feb 11, 2011
Messages
16
On my switchboard im trying to display the current date and time, ive retrieved a peice of code but it does seem to work, am i missing something?:

'TO DISPLAY THE CURRENT TIME AND DATE
Private Sub Form_Load()
txtDayOfWeek = WeekdayName(Weekday(Date), , vbSunday)

End Sub

Private Sub Form_Timer()
txtDateTime = Now()
End Sub

Private Sub txtDateTime_BeforeUpdate(Cancel As Integer)
End Sub
 
Are txtDayOfWeek and txtDateTime Controls on your Form? To what have you set the TimerInterval? FYI, most developers avoid these as they consume a great deal of the computer.
 
txtDateTime is a text box in the form yes, txtDayOfWeek is not, however the bloke I got the off didnt have DayOfWeek either, and on his form the date was working and clock was working even with the seconds ticking. I havnt set a timer interval, i dont know what that is. I dont have to put this into my database but I thought it would look impressive. any ideas on how to make it work mate?
 
The Timer Interval defaults to 0 which is disabled. It is expressed in MilliSeconds so 1000 = 1 second. The property is available on the Event tab of the Form's property sheet.
 
mate, thank you so much!! iv been bustin my ass tryin to get that to work! u tha man!!
 

Users who are viewing this thread

Back
Top Bottom