P
Paul Overway
Create table named tblSQL with two fields
QueryName Text 255
SQL Memo
Then run the following code to populate the table:
Sub GetSQL()
Dim db as database
Dim rst as recordset
dim qdf as querydef
Set db = currentdb()
Set rst = db.OPenrecordset("tblSQL")
For each qdf in db.QueryDefs
With rst
.AddNew
.fields("QueryName")=qdf.Name
.fields("SQL")=qdf.SQL
.Update
End With
Next
End Sub
You should then be able to export the table to text with all of the SQL.
QueryName Text 255
SQL Memo
Then run the following code to populate the table:
Sub GetSQL()
Dim db as database
Dim rst as recordset
dim qdf as querydef
Set db = currentdb()
Set rst = db.OPenrecordset("tblSQL")
For each qdf in db.QueryDefs
With rst
.AddNew
.fields("QueryName")=qdf.Name
.fields("SQL")=qdf.SQL
.Update
End With
Next
End Sub
You should then be able to export the table to text with all of the SQL.