Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing all spaces in Query names to underscores

Status
Not open for further replies.
Mar 6, 2003
157
JO
Hi,

I have about 4300 queries in an Access 2000 DB. I'm using a 3rd party tool to read in the queries. However, my 3rd party tool complains whenever it finds blanks in any query names.

I was wondering if there is there any way to automatically search for all blanks in all query names in an Access DB and to replace all the blanks with underscores.

Any help would be immensely appreciated.

Regards,
Shawn
 
Wow, 4300 queries is a lot! I can't imagine any application that would require this many unique queries unless criteria are hard-coded into many similar queries. You could maybe use find and replace tools like those mentioned at Tony's site
Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Changing the query names is a simple issue.
It's finding all the references to those queries that will be the real job, won't it?
You probably need one of the FMS tools to do this properly.


Backup your db.
Run this sub; then fix all your

Sub FixQNames()

Dim qdf As DAO.QueryDef

For Each qdf In CurrentDb.QueryDefs
If Left(qdf.Name, 1) <> "~" Then qdf.Name = Replace(qdf.Name, " ", "_")

Next qdf

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top