[AccessD] Turn a recordset into an actual table
Arthur Fuller
fuller.artful at gmail.com
Wed Oct 27 08:03:46 CDT 2021
Thanks, Stuart
What would be the equivalent to display the SQL for a named Record Set
rather than a QueryDef?
On Tue, Oct 26, 2021 at 5:58 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:
> On 26 Oct 2021 at 11:22, Arthur Fuller wrote:
>
> > The code depends on the existence of a named RecordSet....
> > button that builds a SQL In() clause
> > from the selected Machine IDs. I plug the resultant In() clause into a
> > queryDef. But I want to be able to browse the result as if it were an
> > actual table....
> >To begin with, I need a tool that, given the name of a QueryDef, shows me
> the SQL.
>
>
> You appear to be conflating the concepts of Recordset and QueryDef.
>
> If you have a QueryDef, you can open it in the QBE grid with
> Docmd.Openquery.
> You can get it's SQL by using th QueryDef object's SQL property
>
> Function ShowQuery() As Long
> Dim strQName As String
> Dim qd As QueryDef
> strQName = "qryMyQuery"
> Set qd = CurrentDb.QueryDefs(strQName)
> MsgBox qd.Name
> MsgBox qd.SQL
> DoCmd.OpenQuery strQName
> End Function
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
Arthur
More information about the AccessD
mailing list