title: Access VBA - method or data member not found error
body: <p>I'm new to Access and thank you for reading this first. </p>
  
  <p>I'm exporting a query in Access to a pipe delimited CSV file. The query is from a table which is ODBCed from SQL. </p>
  
  <blockquote>
    <p>I've been getting for the line <code>dbs.Recordset</code> : Method or data member not found error. </p>
  </blockquote>
  
  <p>Huge thanks for any suggestion to fix this.</p>
  
  <pre><code>Option Compare Database
  Option Explicit
  
  Sub Command12_Click()
  Dim dbs As DAO.database 
  Dim rst As DAO.Recordset
  Dim intFile As Integer
  Dim strFilePath As String
  Dim intCount As Integer
  Dim strHold
  
  strFilePath = "C:\temp\TEST.csv"
  
  Set dbs = CurrentDb
  
  Set rst = db.OpenRecordset("T_Export_CSV", dbOpenForwardOnly)
  
  intFile = FreeFile
  
  
  Open strFilePath For Output As #intFile
  
  Do Until rst.EOF
     For intCount = 0 To rst.Fields.Count - 1
     strHold = strHold &amp; rst(intCount).Value &amp; "|"
     Next
     If Right(strHold, 1) = "|" Then
        strHold = Left(strHold, Len(strHold) - 1)
     End If
     Print #intFile, strHold
     rst.MoveNext
     strHold = vbNullString
  Loop
  
  Close intFile
  rst.Close
  Set rst = Nothing
  
  MsgBox ("Export Completed Successfully")
  End Sub
  </code></pre>
  
  <p>Thank you so so much for your time and please leave any comment below for any clarification if needed. I will try my best to be responsive!   </p>