Hi,
I use a database to open word documents and populate them with information. As of this morning that no longer works. Here is my code ( there are a dozen like this and none work this is just the shortest):
Private Sub Command16_Click()
Dim appWord As Word.Application
Dim doc As Word.Document
Dim strSQL As String
Dim strReportsTo As String
Dim fullpath As String
On Error Resume Next
Set appWord = GetObject(, "Word.application")
With appWord
Set doc = .Documents.Add(Template:="H:\Forms\Form1.dot", newtemplate:=False, Documenttype:=0)
With doc
.FormFields("number").Result = (Me!Number) & ""
.FormFields("Date").Result = (Me!Date1) & ""
.FormFields("LastName").Result = (Me!LastName) & ""
.FormFields("FirstName").Result = (Me!FirstName) & ""
.FormFields("Client").Result = (Me!Client) & ""
.FormFields("Employee").Result = (Me!Employee) & ""
End With
.Visible = True
.Activate
End With
Set rst = Nothing
Set doc = Nothing
Set appWord = Nothing
End Sub
It stopped working while I was working on making a new databse this morning. It works fine when I borrow someone else's login, but no longer functions for me.
Thanks for your help.
I use a database to open word documents and populate them with information. As of this morning that no longer works. Here is my code ( there are a dozen like this and none work this is just the shortest):
Private Sub Command16_Click()
Dim appWord As Word.Application
Dim doc As Word.Document
Dim strSQL As String
Dim strReportsTo As String
Dim fullpath As String
On Error Resume Next
Set appWord = GetObject(, "Word.application")
With appWord
Set doc = .Documents.Add(Template:="H:\Forms\Form1.dot", newtemplate:=False, Documenttype:=0)
With doc
.FormFields("number").Result = (Me!Number) & ""
.FormFields("Date").Result = (Me!Date1) & ""
.FormFields("LastName").Result = (Me!LastName) & ""
.FormFields("FirstName").Result = (Me!FirstName) & ""
.FormFields("Client").Result = (Me!Client) & ""
.FormFields("Employee").Result = (Me!Employee) & ""
End With
.Visible = True
.Activate
End With
Set rst = Nothing
Set doc = Nothing
Set appWord = Nothing
End Sub
It stopped working while I was working on making a new databse this morning. It works fine when I borrow someone else's login, but no longer functions for me.
Thanks for your help.