Results 1 to 6 of 6

Thread: Time Stamping

  1. #1
    Join Date
    Mar 2011
    Posts
    28

    Unanswered: Time Stamping

    I want to time stamp 2 items.

    1. Every time a new record is created by user,
    2. Every time the same record is completed.

    How easy/reliable is this to do?

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    With two fields TimeStamp_Start and TimeStamp_End.

    To timestamp a new record being created
    Code:
    Private Sub Form_Current()
       If Me.NewRecord Then Me.TimeStamp_Start = Now()
    End Sub
    If your 'end' timestamp means when the newly created record is first saved
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
        If Me.NewRecord Then Me.TimeStamp_End = Now()
    End Sub
    If by 'is completed' you mean something else, such as when all fields are populated, even if some are filled in at a later time, that will a little more complicated, depending on your requirements.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    For the first requirement you can even let Access do the job with no code at all. Add a field in the table with:
    - Field Name: Date_Created
    - Data Type: Date/Time
    - Default Value: Now()
    - Required: Yes
    Attached Thumbnails Attached Thumbnails ScreenShot314.jpg  
    Have a nice day!

  4. #4
    Join Date
    Mar 2011
    Posts
    28
    Thanks very much guys. I'll try both both methods today.

    Eventually i'd like 4 time stamps. But first I'd just like to get my head round stamping each record or (workcase).

    Eventually. It'll be;

    Logged in
    Start new record (Everytime a new record starts)
    Complete said record (Everytime another record is started or informartion is added to initial record)
    Logged out

    Users can log out 3/4 times in a day and then work on another system which automatically record similar info.

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by Range View Post
    Complete said record (Everytime another record is started or informartion is added to initial record)
    To timestamp when a new record is finished or info is added to an initial record you'd omit the reference to NewRecord and simply use

    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
        TimeStamp_End = Now()
    End Sub
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Mar 2011
    Posts
    28
    ahh ok.

    I used 2 command buttons. with something like

    Private_Start_sub()
    dim s as integer
    s = now()
    start_now = s
    End Sub

    Private_Start_sub()
    dim e as integer
    e = now()
    start_now = e
    next record
    End Sub


    Sorry my programming off the tope of my head is rubbish - but u get the gist. Im at home now so cant reference it properly. If multiple users were carrying out my method would this cause problems or inaccuracies? Thanks

Posting Permissions

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