Unanswered: Read Start and Stop time from timer control (Was "Help needed..urgent")
I'm not too good in Access. Currently i developing an access database. It need to have start stop button with timer. I have created the start stop button and the timer. I having difficulity in taking the start time and stop time. Can anyone help me how to get this done. Its urgent. Thank you for your kind help.
A classical way of handling this is to use the same button to perform both tasks
use a static variable to stroe the data, or a module or even global varaible if preferred
' to be placed inside the <mycommandbutton>.onclick event
static EventTime as date
if <mycommandbutton>.caption = "&Start" then ' the timer isn't active
<mycommandbutton>.caption = "S&top"
else ' the timer was active
'use EventTime Wherever you want to
<mycommandbutton>.caption = "&Start"
you must alwasy make sure the caption on the button is &Start on loading the ofrm.. set it via the forms on load event
The start button should record the time we click the start button to the start txtbox..
The stop button should record the time we click stop button to the stop txtbox.
I tried to use the now() function but it only takes the time i click save.
Actually Now() does give you the date and time, only the formatting of the text boxes makes it look otherwise.
Me.txtStart = Now() will do it for the start button (in the simple design paradigm) and just format the textbox to something like "d mmm yyyy at h:nn:ss AMPM" (without the quotes) or whatever format you want really.