title: Run query connected to another database in VBA Access
body: <p>I am trying to run saved query inside VBA Access. That query is connected to another database and looks like that:</p>
  
  <pre><code>SELECT * FROM TABLE IN 'C:\USERS\Another_database.accdb'
  </code></pre>
  
  <p>This query is saved as "My_query" inside first Access database. VBA code looks like this: </p>
  
  <pre><code>Function My_function()
       Set rst = CurrentDb.OpenRecordset("My_query", dbOpenDynaset)
  End Function
  </code></pre>
  
  <p>When I try to run it i got an error:</p>
  
  <blockquote>
    <p>Run-time error '3219'</p>
  </blockquote>
  
  <p>Any ideas why? It works for normal queries (without <code>IN 'C:\USERS\Another_database.accdb'</code> part.</p>