Cannot open Access 2000 query

betmck

Registered User.
Local time
Today, 17:56
Joined
Apr 17, 2008
Messages
13
I have a query that is used to generate a report. When I try to open the query design it gives a message that 'there is a missing ),] or item in query expression'. When I select OK it exits the query. I also tried accessing the query from the report properties, but same problem. How can I open the query to correct the error?
 
Have you tried opening it using sql view?
 
No. Please how do you open in sql view?
 
If you right click on it can you get into design view?
 
Thanks for such quick responses. When I right click, it opens the query with the error message. When I click OK to close the error message, it also closes the query.
 
Thanks for such quick responses. When I right click, it opens the query with the error message. When I click OK to close the error message, it also closes the query.


Have you got a backup of your database? I think what has happened there is that you deleted a field from one of the tables that query was linked to.
 
Yes, I have a backup but I didn't delete any fields.
 
Yes, I have a backup but I didn't delete any fields.


Try importing that query from your backup into your main database. I would advise you create another backup and test it on that first
 
This might have been around for a while because I restored several backups, even end of year 2009, but the same problem. Can we edit the query any other way? Thanks for all your help.
 
Create a textbox and a command button on a form. On the On Click event of the button paste this code:

Code:
TextBoxName.value CurrentDb.QueryDefs("NameOfQuery").SQL
Replace Textboxname with the name of your newly created text box also replace NameOfQuery with the name of the query. Open the form in form view, click the button and copy and paste the full string from the text box on here.
 
Or simpler still, just go into the VBA Window to the Immediate Window and then put a question mark and paste that:

?CurrentDb.QueryDefs("NameOfQuery").SQL

hit enter and you should see the SQL string. (make sure you replace NameOfQuery with the actual name of your query.
 
Or simpler still, just go into the VBA Window to the Immediate Window and then put a question mark and paste that:

?CurrentDb.QueryDefs("NameOfQuery").SQL

hit enter and you should see the SQL string. (make sure you replace NameOfQuery with the actual name of your query.

I completely forgot about that. Thanks for posting that tip.
 
Thank you very much guys. I can now edit my query
 

Users who are viewing this thread

Back
Top Bottom