extract SQL sentence from a query via vba code

  • Thread starter Thread starter thread
  • Start date Start date
T

thread

Hi all,

is it posible to extract SQL sentence from a query via VBA code?
 
Hi

Yes...

Dim MyQuery As QueryDef
Dim QuerySQL As String
QuerySQL = CurrentDb.QueryDefs("qryName").SQL
MsgBox QuerySQL

Regards

Andy Hull
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top