Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jun 2003
    Thanked 0 Times in 0 Posts

    Inserting System time in a field (Access 97)

    I'm trying to create a form that will display the system time in a field when that field is clicked on, and then store that value in a table for later use in a report. I've tried using the expression "=Time()" in the On Click field of the Event tab for the properties window for the field but it doesn't seem to do what I want. (When I click on the field in Form View nothing happens.) I've tried using both bound and unbound text boxes and list boxes for this with the same result. I tried writing an Event Procedure for it as well without success. Can someone help me out?


  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Inserting System time in a field (Access 97)

    Bind the text box to the field in the table (= set the control source to the name of the field).
    Click inside the box corresponding to the On Click event of the text box.
    From the dropdown list, select Event Procedure.
    Click the builder button (the three dots to the right).
    Make the code look as follows, substituting the name of the text box for txtTime:

    Private Sub txtTime_Click
    txtTime = Now
    End Sub

Posting Permissions

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