displaying date and time in access

baroom

Registered User.
Local time
Today, 05:26
Joined
May 29, 2009
Messages
19
hello every body,
i wat to display current date and current time in my form but
the problem is with the time, it is not changing with the real time changes. it is possible to display a running time in access from. and regarding date i want to display the complete name of the current day in my form some thing like this "friday, june 2009.
if this is possible please help me.

million thanks in advance
baroom
 
With an unbound control named txtDateTime, using the Timer Event:

Code:
Private Sub Form_Load()
 Me.TimerInterval = 1000
 Me.txtDateTime = Format(Now, "dddd, mmmm dd, yyyy hh:nn:ss")
End Sub

Private Sub Form_Timer()
 Me.txtDateTime = Format(Now, "dddd, mmmm dd, yyyy hh:nn:ss")
End Sub
 
thanks a lot for ur reply but one thing i dont no, as i am new to access where can we get the Form_Load() and Form_Timer() events. please help me
 
  1. Copy to the Clipboard the code provided above
  2. In Design View for your form, place a textbox on your form.
  3. Name the textbox txtDateTime.
  4. Press <Control> + <G>
  5. You should now be in the code window for your form
  6. Place your cursor below the Option Compare declaration (probably Option Compare Database)
  7. Paste the code in here
  8. Press on the red Access key icon
  9. You should now be back in Design View
  10. Run your form.
 
This old post has helped me resolve my issue.

Thanks

Mafhobb
 
Glad we could help! And it's always good to see someone who takes the time to search the site before posting a question. :D
 

Users who are viewing this thread

Back
Top Bottom