When I execute the below function I get an error. If I use the commented out "Open" line it works fine. I get Run-time error '52'. Bad file name or number.
Private Sub GenerateSSA_Click()
Dim strRA As Variant, strFileNew As String, strFileBlank As String
Dim intFileOut As Integer
Dim rstWork As DAO.Recordset
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
intFileOut = FreeFile()
strFileBlank = Me![MPathSSABlank]
strFileNew = Me![MPathSSANew]
If FileExists(strFile) = False Then
FileCopy strFileBlank, strFileNew
End If
' Open "c:\users\john employee\documents\access\ssatsi2013.txt" For Append As intFileOut
Open strFileNew For Append As intFileOut
Private Sub GenerateSSA_Click()
Dim strRA As Variant, strFileNew As String, strFileBlank As String
Dim intFileOut As Integer
Dim rstWork As DAO.Recordset
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
intFileOut = FreeFile()
strFileBlank = Me![MPathSSABlank]
strFileNew = Me![MPathSSANew]
If FileExists(strFile) = False Then
FileCopy strFileBlank, strFileNew
End If
' Open "c:\users\john employee\documents\access\ssatsi2013.txt" For Append As intFileOut
Open strFileNew For Append As intFileOut