Hi. If the user adds or updates a call detail record (on a subform) I need to update the last contact date in the contact record. The main form is based on a query, so I can't just set the form field to date. Here is my code. I get Run time error 3800, 'contactID' is not an index for this table".
But it is! Any help would be appreciated. Thanks.
Private Sub Form_AfterUpdate()
Dim myDB As Database
Dim myRS As Recordset
Set myDB = CurrentDb
Set myRS = myDB.OpenRecordset("tblContact", dbOpenTable)
myRS.Index = "contactID"
myRS.Seek "=", Me.rs_contactID
myRS.Edit
myRS!cont_date_last_contacted = Date
myRS.Update
myRS.Close
End Sub
But it is! Any help would be appreciated. Thanks.
Private Sub Form_AfterUpdate()
Dim myDB As Database
Dim myRS As Recordset
Set myDB = CurrentDb
Set myRS = myDB.OpenRecordset("tblContact", dbOpenTable)
myRS.Index = "contactID"
myRS.Seek "=", Me.rs_contactID
myRS.Edit
myRS!cont_date_last_contacted = Date
myRS.Update
myRS.Close
End Sub