Friday, May 2, 2014

AfterUpdate event

'event' is computer jargon meaning: something that happens in a computer program.

Here's an example:

Option Compare Database

Private Sub Form_AfterUpdate()

    Dim theDatabase As Database ' DEFINE A DATABASE VARIABLE
   
    Set theDatabase = CurrentDb ' SET IT TO THIS HERE DATABASE
   
    ' EXECUTE AN SQL COMMAND TO ADD A RECORD TO LOGFILE
    theDatabase.Execute "INSERT INTO tblLOGFILE (LogDesc) " _
                        & " VALUES ('" _
                                  & PlanetName _
                                  & "' & ' updated'" _
                                  & ")"
               
    theDatabase.Close ' CLOSE THE CONNECTION TO THE DATABASE
   
    Set theDatabase = Nothing ' CLEAR OUT THE MEMORY USED BY IT
   

End Sub