I've managed to get a function working that allows the user to create a PowerPoint slide from a given report. Where I'm hitting a roadblock is when I establish the RecordSource. Some of the reports get their data from a named query, some from a fully described SQL statement.
In the latter cases, the following works.
When I know, I'm dealing with a query, the following will give me what I need (having run the previous code first).
What I now want is some method of detecting if the RecordSource property is the name of query or not. I'm assuming I could cycle through all query names in the Database and look for a match, but my VBA isn't up to that, at present
.
Any suggestions gratefully received.
In the latter cases, the following works.
Code:
str_RecordSource = Reports(CurrentOpenReport).RecordSource
Code:
Dim QDF As QueryDef
Set QDF = CurrentDb.QueryDefs(str_RecordSource)
str_Actual_RecordSource = QDF.SQL

Any suggestions gratefully received.