I have a datasheet that contains work order numbers that i have set up so that when the user clicks one a word file is created using the "template", the information is entered and the files is saved. The last part is the problem. When i click on the number to create the file i get this error message "5096EOALPHABETICARABICARABICABJADARABICALPHABAHTTEXTCAPSCARDTEXTCHARFORMATCHI (10-6488_2363333.DOC)". The last few numbers that are in parenthasis is the name of the file it was ment to be saved as. I finaly figured out that it may be a problem with word not being able to "save as". In word, when i click save as and enter an unused file name word acts like the file name IS in use and is open, giving me this error message " *file name* is currently in use. Try again later". These errors are also intermitant, not showing up every time but still very often. I fixed it once by running a diagnostic but the errors came back. Here is my code.
Option Compare Database
Const DOC_PATH As String = "H:\Access Files\Work Orders\"
Const DOC_NAME As String = _
"BlankWO6.doc"
Private Sub WorkOrder_Click()
Dim appWord As Word.Application
Dim doc As Word.Document
Dim rst As DAO.Recordset
Dim strSQL As String
Dim strReportsTo As String
Dim varX As String
Dim URL As String
Dim CNM As String
Dim URM As String
Dim URS As String
Dim dbWorkOrders As Object
Dim rstWOs As Object
Dim fldEnumerator As Object
Dim fldColumns As Object
Set dbWorkOrders = CurrentDb()
Set rstWOs = dbWorkOrders.OpenRecordset("Work Order")
Set fldColumns = rstWOs.Fields
On Error Resume Next
Set appWord = GetObject(, "Word.application")
If Err = 429 Then
Set appWord = New Word.Application
Err = 0
End If
'---------'
' Look Up '
'---------'
URL = Nz(DLookup("", "[Work Order]", "[WO ID] =" _ & ...ndler: MsgBox Err & Err.Description End Sub
Option Compare Database
Const DOC_PATH As String = "H:\Access Files\Work Orders\"
Const DOC_NAME As String = _
"BlankWO6.doc"
Private Sub WorkOrder_Click()
Dim appWord As Word.Application
Dim doc As Word.Document
Dim rst As DAO.Recordset
Dim strSQL As String
Dim strReportsTo As String
Dim varX As String
Dim URL As String
Dim CNM As String
Dim URM As String
Dim URS As String
Dim dbWorkOrders As Object
Dim rstWOs As Object
Dim fldEnumerator As Object
Dim fldColumns As Object
Set dbWorkOrders = CurrentDb()
Set rstWOs = dbWorkOrders.OpenRecordset("Work Order")
Set fldColumns = rstWOs.Fields
On Error Resume Next
Set appWord = GetObject(, "Word.application")
If Err = 429 Then
Set appWord = New Word.Application
Err = 0
End If
'---------'
' Look Up '
'---------'
URL = Nz(DLookup("", "[Work Order]", "[WO ID] =" _ & ...ndler: MsgBox Err & Err.Description End Sub