title: Group Email using MS Access
body: <p>I'm using an MS access query in which I want to pull all the emails from the query and then populate an outlook email with all the emails, the code will run but, it does not pull in the email addresses and i cannot seem to figure out why.. here is what i have so far. My thoughts are than the query used in populating the table is not being called when trying to pull the emails</p>
  
  <pre><code>Private Sub Command30_Click()
      On Error GoTo Err_Command30_Click
  
      Dim stDocName As String
  
      stDocName = "Department E-Mail"
      DoCmd.OpenQuery stDocName, acNormal, acEdit
  
      Dim r As Recordset
      Dim Email As String
      Set r = CurrentDb.OpenRecordset("SELECT[tbl dmgrphcs].Email FROM [tbl  dmgrphcs]WHERE(([tbl     dmgrphcs].Email) Is Not Null);")
  
      Do While Not r.EOF
          Email = Email &amp; r(0) &amp; ";"
          r.MoveNext
      Loop
      r.Close
  
      DoCmd.SendObject acSendNoObject, Null, Null, "", "", Email, "", "", True, Null
  
  Exit_Command30_Click:
      Exit Sub
  
  Err_Command30_Click:
      MsgBox Err.Description
      Resume Exit_Command30_Click
  
  End Sub
  </code></pre>