Dates - initial and modification

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kish
    New Member
    • Jul 2010
    • 3

    Dates - initial and modification

    I am creating a sales tracker for work and I am trying to have it so for each sales form I can have an initial entry date and a modification date. Is there a way to lock the initial entry date so that it won't change after the initial entry and have the modification date change every time information is updated?
  • hype261
    New Member
    • Apr 2010
    • 207

    #2
    Originally posted by Kish
    I am creating a sales tracker for work and I am trying to have it so for each sales form I can have an initial entry date and a modification date. Is there a way to lock the initial entry date so that it won't change after the initial entry and have the modification date change every time information is updated?
    Generally what I do is hook into the before_update event for the form and when the form is updated I set the modification date gets Date().

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      In keeping with hype261's suggestion:
      Code:
      Private Sub Form_BeforeUpdate(Cancel As Integer)
       If Me.NewRecord Then
         Me.OriginalEntryDate = Date
       Else
         Me.ModificationDate = Date
       End If
      End Sub
      Welcome to Bytes!

      Linq ;0)>

      Comment

      • Kish
        New Member
        • Jul 2010
        • 3

        #4
        Thanks for the help guys. I'm new to Access and am still a bit confused but I think I figured it out.

        Comment

        Working...