Microsoft Access auto-updating exisiting records in a form not working.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aleseus
    New Member
    • Feb 2010
    • 7

    Microsoft Access auto-updating exisiting records in a form not working.

    I have an access database with about 3000 records, and we need to go thru this and update certain information in the records. I have created a form that has the following code...

    Code:
    Private Sub Form_Dirty(Cancel As Integer)
    Me.Call_Date = Date
    End Sub
    This code, I thought, would update the CALL DATE field to the most current date once a modification has been made. It works for New records, but not working for existing records.

    Any and all help is appreciated.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    If you want to update all records in a table then you need an UPDATE query.

    Why don't you set down clearly exactly what you're trying to do and we can look at giving you a hand.

    Comment

    • aleseus
      New Member
      • Feb 2010
      • 7

      #3
      I am having 2 people access the data in the database. they will be doing this project over a couple of weeks. I have added a field called CALL DATE to the database. when they go into a record on the form and modify something on there, I want the form to auto-populate todays date, so I have a record of when this person was contacted last. I have added the code...

      Code:
      Private Sub Form_Dirty(Cancel As Integer) 
      Me.Call_Date = Date 
      End Sub
      ... to the form, and when I add a new record, it will auto-populate the information. When I go into an existing form, it will not place the information in the CALL DATE field. I am looking to have it update automatically so I can have a record of when a record was modified last. if the go into a record, and no changes are made, it should not modify the CALL DATE field.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        Ah. That's quite different then. Ignore the SQL in that case.

        The event you're looking for would be the BeforeUpdate event then.

        Welcome to Bytes!

        Comment

        Working...