Adam-
Depends on what you mean by "open a query". If you want to open it as a Recordset in code to manipulate it, then simply use what's in stSQL as the target of an OpenRecordset.
What is it you're trying to accomplish?
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
(Paris, France)
On Feb 18, 2015, at 5:22 PM, runuphillracing@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
How do I open a query based on SQL I write within VB? I want to try doing this rather than creating and using a stored query, as in DoCmd.OpenQuery "qryName"
stSQL = "SELECT Source.DMADES, Count(Source.TN) AS CountOfTN " & _
"FROM Source GROUP BY Source.DMADES ORDER BY Count(Source.TN) DESC;"
Thanks
Adam
__._,_.___
Posted by: John Viescas <johnv@msn.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar