title: Access VBA exporting CSV file as UTF-8
body: <p>I have to export data from Access multiple times a day as a CSV file. The person who had my job before me created this VBA code that exports the data in the click of a button. However, I need to modify it so that it exports as UTF-8 without BOM so that international characters will show up in the software that I import it to.</p>
  
  <p>I can manually export as Text and then save it as CSV, when I go to the "Advanced..." settings I select <code>Code Page: Unicode (UTF-8)</code> and this works perfectly. But as I said before, I want to change the VBA code:</p>
  
  <pre><code>Private Sub Command6_Click()
  Dim sExportPath As String
  Dim qry As DAO.QueryDef
  
  
  With Me.List0
      For i = 0 To .ListCount - 1
          If .Selected(i) Then
              sExportPath = Application.CurrentProject.Path &amp; "\final_" &amp; Left(Me.List0.Column(0, i), InStr(Me.List0.Column(0, i), " ") - 1) &amp; ".csv"
              If QueryExists("Final") Then CurrentDb.QueryDefs.Delete "Final"
  
  
              Set qry = CurrentDb.CreateQueryDef("Final", "Select Salutation,Email from " &amp; Left(Me.List0.Column(0, i), InStr(Me.List0.Column(0, i), " ") - 1))
              CurrentDb.QueryDefs.Refresh
              DoCmd.TransferText acExportDelim, , "Final", sExportPath, True
  
          End If
      Next i
  End With
  End Sub
  </code></pre>