M
metalicsillver
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")
MySet.Update
Debug.Print WordDoc & " 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 Documents for information."
MySet.Close
End If
End Function
I keep on getting a null string for myset even the table exist. Not sure
what I'm doing wrong. 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")
MySet.Update
Debug.Print WordDoc & " 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 Documents for information."
MySet.Close
End If
End Function
I keep on getting a null string for myset even the table exist. Not sure
what I'm doing wrong. Thanks.