title: VBA runtime error 3625 The text file specification Export_Spec does not exist
body: <p>I am running Access 2016. I am trying to export the results of a query into a text file, I keep on getting an error 3625 no spec is found. I created the spec and if I run the spec it works as expected. I tried putting quotes instead of the export spec, but there was no formatting on the file. The solutions I found on the web were saying to use the advanced tab to define formatting, On my version of Access 2016 there is no advanced tab in the spec creation process. I have stepped through the process and all the directories and the file name is created properly.
  The error occurs on the line :
  DoCmd.TransferText TransferType:=acExportDelim, SpecificationName:=strExportSpec, TableName:=strQueryName, FileName:=strFullName, HasFieldNames:=True</p>
  <p><a href="https://i.stack.imgur.com/9CBbe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9CBbe.png" alt="Spec Description" /></a></p>
  <p>Any help is appreciated.</p>
  <pre><code>Private Sub Export_Click()
  Dim strFileName As String
  Dim lFileName As Long
  Dim strCurrentDate As String
  Dim strFormattedDate As String
  Dim dtCurrentDate As Date
  Dim strDir As String
  Dim strFullName As String
  Dim strExportSpec As String
  Dim strQueryName As String
  Dim strYear As String
  Dim strMonth As String
  Dim strPath1 As String
  Dim strPath2 As String
  
  
  strYear = Format(Date, &quot;yyyy&quot;)
  strMonth = Format(Date, &quot;mm&quot;)
  
  'Check if Directory Year exists
  strPath1 = &quot;C:\Users\Owner\Google Drive\Employment\Mass Unemployment\&quot; &amp; strYear
  
  
  'Check if year exists
  If Dir(strPath1, vbDirectory) = &quot;&quot; Then
      MkDir strPath1
  End If
  'Create
  
  strPath2 = &quot;C:\Users\Owner\Google Drive\Employment\Mass Unemployment\&quot; &amp; strYear &amp; &quot;\&quot; &amp; strMonth &amp; &quot;\&quot;
  
  If Dir(strPath2, vbDirectory) = &quot;&quot; Then
      MkDir strPath2
  End If
  
  strCurrentDate = Date
  strFormattedDate = Format(strCurrentDate, &quot;mmddyyyy&quot;)
  lFileName = InputBox(&quot;Enter Week Number&quot;, &quot;Enter Week Number&quot;)
  
  strFileName = strFormattedDate
  strFullName = strPath2 &amp; strFileName &amp; &quot;.txt&quot;
  strExportSpec = &quot;Export_Spec&quot;    ' error 3625 export spec does not exist
  strQueryName = &quot;qryUnEmployment&quot;
  
  DoCmd.TransferText TransferType:=acExportDelim, SpecificationName:=strExportSpec, TableName:=strQueryName, FileName:=strFullName, HasFieldNames:=True 
   
  End Sub
  </code></pre>