title: Select acces datatbase in word 2010
body: <p>I have to select some rows from an access in <code>word 2010 in vba</code>, now i would like to select some things but I get an error which says my Select is wrong can you help me ? </p>
  
  <pre><code>Private Sub CommandButton1_Click()
  Dim jahr As String
  Dim LfdNummer As Integer
  Dim db As DAO.Database
  Dim rs As DAO.Recordset
  Dim strSql As String
  jahr = TextBox1
  LfdNummer = TextBox2
  
  
  
  
  Private Sub CommandButton1_Click()
  Dim jahr As String
  Dim LfdNummer As Integer
  Dim db As DAO.Database
  Dim rs As DAO.Recordset
  Dim strSql As String
  jahr = TextBox1
  LfdNummer = TextBox2
  
  
  
  
  Set db = CreateObject("DAO.DBEngine.120").OpenDatabase("C:\User/012886\Documents\Hendrik\trilux\EMV\Beispiel_EMV.accdb")
  
  ' Daten lesen und weiterverwenden -&gt; über Recordset
  
  Set rs = db.OpenRecordset("SELECT * FROM ITZ-EMV-Messungen")
  Do While Not rs.EOF
  
    rs.MoveNext
  Loop
  
  
   rs.Close
   db.Close
  
  End Sub
  </code></pre>