Batch editing queries

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I need go through a large number of queries and do some intelligent
find/replace. Is there a way via vba code to traverse through all queries,
edit and then save?

Many Thanks

Regards
 
John said:
I need go through a large number of queries
and do some intelligent find/replace. Is there
a way via vba code to traverse through all
queries, edit and then save?

It's not a free solution, but I have had good luck with a third-party
product in all versions of Access in which I have used it, through Access
2003: Find and Replace from Rick Fisher Software, http://www.rickworld.com.

Larry Linson
Microsoft Office Access MVP



__________ Information from ESET Smart Security, version of virus signature database 4050 (20090503) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim strSQL As String

Set dbCurr = CurrentDb()
For Each qdfCurr In dbCurr.QueryDefs
strSQL = qdfCurr.SQL
strSQL = Replace(strSQL, "Field1", "SomeOtherField")
strSQL = Replace(strSQL, "Table1", "SomeOtherTable")
qdfCurr.SQL = strSQL
Next qdfCurr
Set dbCurr = Nothing
 

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