I want to write a very simple code in Access-VBA. I want to write the time in a button caption, but my code does not work.
Private Sub Form_Timer()
Me.TimerInterval = 0
Befehl94.Caption = Time
End Sub
Could you please help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need to set the TimerInterval on the form’s properties menu rather than the “Form_Timer” event as this is triggered based on the value entered in the forms properties.
The value is in milliseconds so 1000 will cause the timer to run every 1 seconds, the “Time” function is also incorrect, your code would be more like this:
Using TimeSerial will give you just the time whereas “Now()” on it’s own will give you TimeDate, you could use the “Format” command instead but I prefer TimeSerial