MS Access (VBA) - DoCmd.OpenQuery (but make the query Pop up)
<p>I have a form which is Modal and Pop up (and then additional code to hide the background) so the client only sees the form.</p>

<p>On this form I have a button which uses the following code to run a query based on the keyword in a text box. </p>

<pre><code>Private Sub Command12_Click()

Dim strsearch As String
Dim Task As String
Dim rs As Recordset
Dim dbs As Database
Dim qdf As QueryDef

Set dbs = CurrentDb()

strsearch = Me.Text13.Value
Task = "SELECT GrantInformation.GrantRefNumber, GrantInformation.GrantTitle, GrantInformation.StatusGeneral, GrantSummary.Summary "
Task = Task &amp; "FROM GrantInformation LEFT JOIN GrantSummary ON GrantInformation.GrantRefNumber = GrantSummary.GrantRefNumber "
Task = Task &amp; "WHERE (((GrantInformation.LeadJointFunder) = 'Global Challenges Research Fund')) Or (((GrantInformation.Call) = 'AMR large collab')) "
Task = Task &amp; "GROUP BY GrantInformation.GrantRefNumber, GrantInformation.GrantTitle, GrantInformation.StatusGeneral, GrantSummary.Summary "
Task = Task &amp; "HAVING (((GrantSummary.Summary) Like ""*" &amp; strsearch &amp; "*"")) OR (((GrantSummary.Summary) Like ""*" &amp; strsearch &amp; "*""));"

Set rs = dbs.OpenRecordset(Task, dbOpenSnapshot)
With dbs
Set qdf = .CreateQueryDef("tmpProductInfo", Task)
DoCmd.OpenQuery "tmpProductInfo"
.QueryDefs.Delete "tmpProductInfo"
End With
dbs.Close
qdf.Close

End Sub
</code></pre>

<p>This all works perfectly. However it shows the Access application and shows the query in there (I dont want them to see the Access application). </p>

<p>Is it possible when running:</p>

<pre><code>DoCmd.OpenQuery "tmpProductInfo" 
</code></pre>

<p>To make it pop up in its own window with VBA?</p>

<p>Many thanks!</p>