Query shuting down

G

Guest

Whenever I try and go into one of my queries, Access shuts down. I am able to
view my tables with no problem. When I try and use one of my queries for a
new query it says there is a circular reference. I really need to access
these queries, and if there's a problem I want to be able to fix it. Please
help if you can ....
 
A

Allen Browne

There are lots of things that can cause Access to crash like that.

The most common cause is Name AutoCorrect.
Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
Then compact the database:
Tools | Database Utilities | Compact/Repair

If any of the tables in this query are attached tables, repeat the steps
above for the back end mdb as well.

If the problem still occurs, the next thing would be to examine the query. I
think you are saying that you can't even go into this query in design view?
If so, you may be able to rescue the query via its SQL statement.
Opening the Immediate Window (Ctrl+G).
Enter:
? CurrentDb.QueryDefs("Query1").SQL
using your query name instead of Query1.
Copy the SQL statement from the Immediate Window.
Paste it somewhere (e.g. into Notepad.)
Delete the query.
Compact the database.
Create a new query, cancelling the Add Tables dialog.
Switch the new query to SQL View (View menu.)
Paste the query statement back in.
Save.
Switch the query to Design View.

If that works, you have rescued the query.
If it does not work, paste the SQL statement as a follow-up to this thread.
 

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

Top