The references are the same.
If I copy the database to the external computer and run it, it uses the current path etc...and if the template is there , the software works again.
Here is the code before.....
Dim strPath As String
Dim strDataSource As String
Dim doc As Word.Document
Dim wrdApp As Word.Application
Const contemplate As String = "Template_1"
Const conquery As String = "Events_Clients Query_Select_1"
On Error GoTo HandleErrors
' Delete the rtf file, if it already exists.
strPath = FixPath(CurrentProject.Path)
strDataSource = strPath & conquery & ".doc"
Kill strDataSource
' Export the data to rtf format
DoCmd.OutputTo acOutputQuery, conquery, _
acFormatRTF, strDataSource, False
' Start Word using mailmerge template
Set wrdApp = New Word.Application
Set doc = wrdApp.Documents.Add(strPath & contemplate)
The path is set correctly and I tried to set it as a string to the correct path, I get the same results...
Could it be a timing issue, because it might take some time to access the host. - maybe a security problem, in thai case, why is the call "strDataSource = strPath & conquery & ".doc"" successful?
Thanks
Josh