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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open non-SQL Query Directly in SQL View? 1

Status
Not open for further replies.

johnnygeo

Programmer
Apr 23, 2003
125
US
I'm using Access 2000 and working on cleaning up an older database. This involves a lot of renaming of tables and queries. Often when I try to open a dependent query in design view, the source tables/queries have been renamed, so the joins get broken, and I have to rebuild the query from scratch.

What I would like to do is open the query in SQL view so I can cut and paste the source table/query names before the design window can screw things up. But I can't seem to access the SQL view button from the database window.

Any advice on how to do this?
 
I would probably create a form with a list box of queries. The row source would be:

SELECT msysobjects.Name
FROM msysobjects
WHERE (((msysobjects.Type)=5));

You could add a text box and some code that would load the sql of the selected query into the text box. Then edit the sql in the text box and use a button to update the sql property of the query.


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
A method I have used to edit or view queries in SQL view that were created in design view is to use "Find and Replace" Perhaps using Find and Replace will enable you to fix the queries without having to edit them at all, otherwise, you can search for a word without replacing it within the query, or queries you choose, when the program finds a match, a window will pop up and one of the options is edit changes which brings up a window where you can edit the SQL statement. You can also copy the SQL statement into a new query and then it can be permanently saved in SQL format so that when you open the query in the future it will open in SQL view. Currently, the price ranges from $15 for Version 2 of Access to $37 for Access 2000 and XP. Here is the link to the site for more information.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top