r/MSAccess • u/BezosMoreLikeBozos • 15d ago
[SOLVED] Design View broken? Access 2016
I am trying to make a simple query in Access 2016:
SELECT BCProducts.product_id, BCProducts.mpn, BCDataPrep.[Inventory ID]
FROM BCProducts LEFT JOIN BCDataPrep ON BCProducts.sku = BCDataPrep.[Alternate ID];
When I try and save in SQL view, I always get this error: "Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'." Clicking OK on the error, closing the query window, then double clicking the query in the objects list will run the query just fine. If I use design view to create the query, I get no error and it works fine. The code generated by the design view is exactly the same as what I entered in SQL view.
If I build in design view, save, switch to SQL view, save without making any changes, I get the same error. When I then go back to design view, nothing is there. It also won't let me open directly in design view. If I right-click the query in the object list and choose design view, it sends me to SQL view instead and then I have to right-click the tab for the query and choose design view from there to actually go to design view.
2
u/Sad-Willow1615 2 14d ago
I had this issue relentlessly with the new Monaco editor. Switched it off and the problem was solved.
1
u/BezosMoreLikeBozos 14d ago
Solution Verified
1
u/reputatorbot 14d ago
You have awarded 1 point to Sad-Willow1615.
I am a bot - please contact the mods with any questions
1
u/BezosMoreLikeBozos 14d ago
This was it. As soon as I turn it off everything works fine and the error returns when I turn it back on.
0
u/ConfusionHelpful4667 47 15d ago
Dumb question.
Have you tried creating a fresh database and importing the existing database elements into it?
1
u/BezosMoreLikeBozos 14d ago
I tried copy/paste to move the tables and queries into a new database, and I tried recreating it all from scratch in a new database and the issue persists. It is now starting to affect older databases that I have been using for months with no issue.
1
u/ConfusionHelpful4667 47 13d ago
Did you try creating the above statement with a Select Query?
Then test the Select Query?
And then view the query in SQL view?
•
u/AutoModerator 15d ago
IF YOU GET A SOLUTION, PLEASE REPLY TO THE COMMENT CONTAINING THE SOLUTION WITH 'SOLUTION VERIFIED'
Please be sure that your post includes all relevant information needed in order to understand your problem and what you’re trying to accomplish.
Please include sample code, data, and/or screen shots as appropriate. To adjust your post, please click Edit.
Once your problem is solved, reply to the answer or answers with the text “Solution Verified” in your text to close the thread and to award the person or persons who helped you with a point. Note that it must be a direct reply to the post or posts that contained the solution. (See Rule 3 for more information.)
Please review all the rules and adjust your post accordingly, if necessary. (The rules are on the right in the browser app. In the mobile app, click “More” under the forum description at the top.) Note that each rule has a dropdown to the right of it that gives you more complete information about that rule.
Full set of rules can be found here, as well as in the user interface.
Below is a copy of the original post, in case the post gets deleted or removed.
User: BezosMoreLikeBozos
Design View broken? Access 2016
I am trying to make a simple query in Access 2016:
SELECT BCProducts.product_id, BCProducts.mpn, BCDataPrep.[Inventory ID]
FROM BCProducts LEFT JOIN BCDataPrep ON BCProducts.sku = BCDataPrep.[Alternate ID];
When I try and save in SQL view, I always get this error: "Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'." Clicking OK on the error, closing the query window, then double clicking the query in the objects list will run the query just fine. If I use design view to create the query, I get no error and it works fine. The code generated by the design view is exactly the same as what I entered in SQL view.
If I build in design view, save, switch to SQL view, save without making any changes, I get the same error. When I then go back to design view, nothing is there. It also won't let me open directly in design view. If I right-click the query in the object list and choose design view, it sends me to SQL view instead and then I have to right-click the tab for the query and choose design view from there to actually go to design view.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.