Invalid Syntax Infinite Loop (1 Viewer)

Zpilot

New member
Local time
Today, 04:41
Joined
Nov 10, 2020
Messages
7
In the Access query builder, as I am entering a formula, if there is a syntax error, I will get the usual error message stating "The expression you entered contains invalid syntax." The problem is, when I click "OK" the message comes back again, and again, and again. It it an infinite loop and the only way I have found to get out of it is filling MS Access in the task manager. Of course I lose all my unsaved work to that point.

Also happens for other syntax errors like "The expression you entered has an invalid string."

I am attaching screenshots for reference, but please do not get hung up on the syntax. I realize the syntax is not valid, it is the infinite loop of errors that results from them that is the issue.

Screenshot 2020-11-05 111957.jpg

Screenshot 2020-11-05 112035.jpg

This has been happening for a while now. Any help anyone could provide would be most appreciated.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:41
Joined
Oct 29, 2018
Messages
21,357
This is probably because Access is trying to execute the bad syntax against all the records in your table. If so, the number of warnings would be the same as the number of records in your table.
 

Zpilot

New member
Local time
Today, 04:41
Joined
Nov 10, 2020
Messages
7
This is probably because Access is trying to execute the bad syntax against all the records in your table. If so, the number of warnings would be the same as the number of records in your table.
Thanks for the reply, but I tried it against an empty table and same results. :(
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:41
Joined
Oct 29, 2018
Messages
21,357
Thanks for the reply, but I tried it against an empty table and same results. :(
Can you post a sample copy of that empty table with the problem? I'd like to see it. Thank you.
 

Minty

AWF VIP
Local time
Today, 09:41
Joined
Jul 26, 2013
Messages
10,353
Something else is up - after hitting ok I get the option to edit the mistake.
If I don't edit it then I get the message again obviously.

Have you compacted and repair your database?
 

Zpilot

New member
Local time
Today, 04:41
Joined
Nov 10, 2020
Messages
7
Something else is up - after hitting ok I get the option to edit the mistake.
If I don't edit it then I get the message again obviously.

Have you compacted and repair your database?
Yes. Happens in any DB.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:41
Joined
Oct 29, 2018
Messages
21,357
Happens to me with any table in any db.
I think it would still help us help you troubleshoot it if you can post a sample db. If it's happening on all your db, it's either something about your db or or your computer. So, if you post a sample db and we don't see any problems, then we can say the issue is probably with your computer.
 

Zpilot

New member
Local time
Today, 04:41
Joined
Nov 10, 2020
Messages
7
I think it would still help us help you troubleshoot it if you can post a sample db. If it's happening on all your db, it's either something about your db or or your computer. So, if you post a sample db and we don't see any problems, then we can say the issue is probably with your computer.
Here you go. I created a new DB 1 one table and 1 query. No records in the table.
The only thing you won't see in it is the bad syntax in the query criteria because when I hit it, the only way out is killing Access via task manager. But here is a screen shot.
SampleDBErr.jpg

Thanks
 

Attachments

  • SampleErr.accdb
    680 KB · Views: 119

theDBguy

I’m here to help
Staff member
Local time
Today, 02:41
Joined
Oct 29, 2018
Messages
21,357
Here you go. I created a new DB 1 one table and 1 query. No records in the table.
The only thing you won't see in it is the bad syntax in the query criteria because when I hit it, the only way out is killing Access via task manager. But here is a screen shot. View attachment 86539
Thanks
Hi. Thanks for indulging us. Just to clarify, is that criteria the letter I followed by a single quote then the letter M and then followed by a double quote?

If so, what is the purpose of that criteria? What were you trying to get out of it.

In any case, sometimes Access is easily confused and provide misleading error messages. If you switch your query to SQL View, you can try running the following SQL statement.
SQL:
SELECT Table1.ID
FROM Table1
WHERE Table1.ID = i'm"

PS. By the way, when I enter that criteria in the query's Design View, I do get the error, but it then goes away after I click the OK button. So, I only see the error message once, and I can quit Access normally.
 

Zpilot

New member
Local time
Today, 04:41
Joined
Nov 10, 2020
Messages
7
Hi. Thanks for indulging us. Just to clarify, is that criteria the letter I followed by a single quote then the letter M and then followed by a double quote?

If so, what is the purpose of that criteria? What were you trying to get out of it.

In any case, sometimes Access is easily confused and provide misleading error messages. If you switch your query to SQL View, you can try running the following SQL statement.
SQL:
SELECT Table1.ID
FROM Table1
WHERE Table1.ID = i'm"

PS. By the way, when I enter that criteria in the query's Design View, I do get the error, but it then goes away after I click the OK button. So, I only see the error message once, and I can quit Access normally.
The criteria is nothing. It is just an something that is invalid. The issue is the recurring error with no way out except to kill the app.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:41
Joined
Oct 29, 2018
Messages
21,357
The criteria is nothing. It is just an something that is invalid. The issue is the recurring error with no way out except to kill the app.
As I said though, I didn't experience that issue. So, at least now you know it's not the database file. In that case, it might be your install of Access or Office or your computer.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:41
Joined
Feb 19, 2002
Messages
42,970
Save early. Save often. That is your only protection during development. There is no reason for leaving modified objects unsaved. You just open yourself up to loss or corruption. Make saving a habit as soon as you finish changing something. Compile before you test - ALWAYS. Develop sound habits to protect yourself.
 

Users who are viewing this thread

Top Bottom