Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    10

    Question Unanswered: start/stop buttons

    I'd like to set up two buttons on my form which will enter the current system time into fields on form. For example, I have a form with has columns for different departments, tasks and start/stop times. They manually enter the date and time now. I would like to have a button that they push that enters the time into a field on the form. I can do it with an shortcut - (ctrl+:, or crtl+ but would like both date and time and thought control button would be more user friendly.

    Any thoughts would be greatly appreciated.

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    No problem. Make a couple of buttons: cmdSetStartTime and cmdSetStopTime.

    In the On Click event procedure for cmdSetStartTime, enter the code:

    Code:
    Me.StartTime = Now()
    and similarly for cmdSetEndTime:

    Code:
    Me.EndTime = Now()
    Should take no time at all
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Aug 2009
    Posts
    10
    Thank you. How do I get them to drop that information into a field on the form. Make the control source on the field the command button names?

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Read my post again. The code does the "dropping".
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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