I am trying to update an open Access DB with information from a MS Word Macro, the problem is that it will not update the field, and I don't know what is the problem. It runs through the whole macro, and does not give me an error message. The following is my code.
Dim DB As database
Dim FndAllTBL, RS, FuntransTbl, FunTBL As recordset
Dim docname As String
Set DB = OpenDatabase(Name:="C:\Documents and Settings\cathie\Desktop\Most Up to date LP LP_Database\LP_Database.mdb"
docname = "#C:\Documents and Settings\cathie\Desktop\Most Up to date LP LP_Database\DOCS" & "-" & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "-" & Hour(Time) & "-" & Minute(Time) & ".doc#"
Set RS = DB.OpenRecordset(Name:="LtrTrans_tbl"
RS.MoveLast
Letterinfo = docname
RS.Edit
RS.Update
ChangeFileOpenDirectory _
"C:\Documents and Settings\cathie\Desktop\Most Up to date LP LP_Database\DOCS"
ActiveDocument.SaveAs FileName:="Dist" & "-" & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "-" & Hour(Time) & "-" & Minute(Time) & ".doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveDocument.Close SaveChanges:=False
MsgBox "You have saved your Distribution to the LP Database Docs Folder as" & "Dist" & "-" & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "-" & Hour(Time) & "-" & Minute(Time) & ".doc"
RS.Close
DB.Close
End Sub
Any help would be greatly appreciated.
Dim DB As database
Dim FndAllTBL, RS, FuntransTbl, FunTBL As recordset
Dim docname As String
Set DB = OpenDatabase(Name:="C:\Documents and Settings\cathie\Desktop\Most Up to date LP LP_Database\LP_Database.mdb"
docname = "#C:\Documents and Settings\cathie\Desktop\Most Up to date LP LP_Database\DOCS" & "-" & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "-" & Hour(Time) & "-" & Minute(Time) & ".doc#"
Set RS = DB.OpenRecordset(Name:="LtrTrans_tbl"
RS.MoveLast
Letterinfo = docname
RS.Edit
RS.Update
ChangeFileOpenDirectory _
"C:\Documents and Settings\cathie\Desktop\Most Up to date LP LP_Database\DOCS"
ActiveDocument.SaveAs FileName:="Dist" & "-" & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "-" & Hour(Time) & "-" & Minute(Time) & ".doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
ActiveDocument.Close SaveChanges:=False
MsgBox "You have saved your Distribution to the LP Database Docs Folder as" & "Dist" & "-" & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "-" & Hour(Time) & "-" & Minute(Time) & ".doc"
RS.Close
DB.Close
End Sub
Any help would be greatly appreciated.