metallicsilver
Technical User
Function UpdateUnmatched(WordDoc)
Dim RecordNo As Long
Dim myDb As DAO.Database
Dim MySet As DAO.Recordset
Set myDb = CurrentDb()
Set MySet = myDb.OpenRecordset("UnmatchedDocuments", dbOpenTable)
MySet.Index = "WordDocFile"
MySet.Seek "=", WordDoc.Value
If MySet.NoMatch Then
MySet.AddNew
MySet!WordDocFile.Value = WordDoc
MySet!TimeStamp.Value = Format(Now(), "hh:mm dd/mm/yy")
Debug.Print DocNameChk & " has been added to the Unmatched Code Table. Please check the table for complete information."
MySet.Close
Else:
MySet.Edit
MySet!WordDocFile.Value = WordDoc
MySet!TimeStamp.Value = Format(Now(), "hh:mm dd/mm/yy")
MySet.Update
Debug.Print "Time for Unmatched Record " & Format(RecordNo, "#") & " has changed. Please check the Unmatched Code Table for information."
MySet.Close
End If
In this code, I'm trying to add any unmatching "WordDoc" to the list along with a time stamp or edit the time stamp for the matching "WordDoc" in the table "UnmatchedDocuments". For some reason, I can't even get the code to find "UnmatchedDocuments". Please help, been looking at this for the last 6 hrs and can't figure it out. Many Thanks.
Dim RecordNo As Long
Dim myDb As DAO.Database
Dim MySet As DAO.Recordset
Set myDb = CurrentDb()
Set MySet = myDb.OpenRecordset("UnmatchedDocuments", dbOpenTable)
MySet.Index = "WordDocFile"
MySet.Seek "=", WordDoc.Value
If MySet.NoMatch Then
MySet.AddNew
MySet!WordDocFile.Value = WordDoc
MySet!TimeStamp.Value = Format(Now(), "hh:mm dd/mm/yy")
Debug.Print DocNameChk & " has been added to the Unmatched Code Table. Please check the table for complete information."
MySet.Close
Else:
MySet.Edit
MySet!WordDocFile.Value = WordDoc
MySet!TimeStamp.Value = Format(Now(), "hh:mm dd/mm/yy")
MySet.Update
Debug.Print "Time for Unmatched Record " & Format(RecordNo, "#") & " has changed. Please check the Unmatched Code Table for information."
MySet.Close
End If
In this code, I'm trying to add any unmatching "WordDoc" to the list along with a time stamp or edit the time stamp for the matching "WordDoc" in the table "UnmatchedDocuments". For some reason, I can't even get the code to find "UnmatchedDocuments". Please help, been looking at this for the last 6 hrs and can't figure it out. Many Thanks.