Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2013
    Posts
    5

    Unanswered: Get time and date of event

    Hi
    I have a form which consist several button which I press when an event is occuring. How can I record in a field the time and date when the button was press. I want to do calculations on the times between the events.
    Thanks in advance
    Abugilda
    Last edited by abugilda; 10-03-13 at 04:00. Reason: spelling mistake

  2. #2
    Join Date
    Nov 2011
    Posts
    413
    SomeTextBox = Date() & " " & Time()

    HTH

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    =now() would be a better bet if you want to store the value.
    you coudl even set this as a default value on the column as part of the table deisgn

    if you need to calcualte differences then use the appropriate date and time functions
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Sep 2013
    Posts
    5

    Button saves the time

    Hi
    I probably did not give the proper details
    I am trying to build a from in which the user may record manually a process. for example: press the button running takes the time - then after a while a falure occures - He presses the button falure the button grabs the time - now I can calculate the time of running and start to measure how long it will take to go back to running - meaning the time that took to solve the failure.
    Thanks in advance
    abugilda

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so you are using buttons on a form to record the tme an event starts and the time an event stops

    there's several wasy round this
    either
    store event start and stop times
    event start time and interval
    event duration
    effectively they are different implementations of the same requirement.
    recording the event start time (and end time OR interval/duration) has the added advantage that you also know WHEN the event occurred which may be of relevance elsewhere

    the easiest appraoch is probably toi have two buttons called, say cmdStart and cmdStop and when htoise buttons are pressed assign the value of now() to the start and stop columns. you will need to build in a bit of logic behind the buttons so that that you cannot press the start/stop buttons if a time is already encoded.

    in terms of user interface, you are probably better having a single button which toggles between start and stop using the captions &Start and &Stop. toggle the state of the button (and captions using code), toggle the enabled state of the button depending if its a new record or not.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •