Solved Error message will not close

Space Cowboy

Member
Local time
Today, 10:46
Joined
May 19, 2024
Messages
245
Hi,
I am typing in a query and ran it.
Getting error message "cannot find the name entered in expression"

I can see my typo but the message will not close down
Anywhere i go its "musical"

Any ideas? I dont want to lose all the work on the SQL
 
This error appears when you try to run the query?

What do you mean by "it's musical"? It plays a sound when you try to run it? Or when you try to close it?
 
when i try to close, bingging and bonging
 
There is some other object interfering. Is your form a popup? Is there another window open? Close every other app. Then you should be able to determine what is preventing the close. OR, add a stop to the code so you have control when the error happens
 
How many records are involved in that table? It is probably making sounds once for each record. Try hitting CTRL key + PAUSE/BREAK key simultaneously (or CTRL first and hold down, then PAUSE/BREAK, then release both). That should stop the sequence of repeated failing actions. OR if it isn't that many records, you could close the error message as many times as there are records in the table.
 
Thanks that worked.
I am Limiting the query to one day so there are only a few hundred records
 
For the record, CTRL/PAUSE stops WHATEVER your code or command is doing of a repetitive nature, such as a code loop or a query loop with a glitch in it. However, CTRL/PAUSE would not have instantly stopped your loop if some records or some steps in the code loop were working correctly. It stops things at the next point where there is a break in the action. Which in your case was the next record, so it was quick.
 
For the record, CTRL/PAUSE stops WHATEVER your code or command is doing of a repetitive nature, such as a code loop or a query loop with a glitch in it. However, CTRL/PAUSE would not have instantly stopped your loop if some records or some steps in the code loop were working correctly. It stops things at the next point where there is a break in the action. Which in your case was the next record, so it was quick.
Hello Doc man,
Thank-you for that explanation.

Is there anything I can write into the code to "stop on error" or something.

It is ok if there are only a few hundred records but when there are tens of thousands you never know if its just the time it takes or stuck somewhere.
 
Depends on how you write and WHAT you write.

In a programmed loop within VBA (only), look up the ON ERROR statement as a way to make things stop and let you decide what to do.


In a bit of SQL (either DoCmd.RunSQL or CurrentDb.Execute) there are things you can do. I find that greater flexibility (and greater immediacy) comes from the .Execute method of the current database or close variations thereof. You can look up the .Execute method as well.

 

Users who are viewing this thread

Back
Top Bottom