I recently ran into an issue that seems to be an unintended side effect of the Monaco SQL editor.
In the latest version of Access I am using (MSO Version 2506 Build 16.0.18925.20076 64-bit), the Monaco editor has been enhanced to offer quite a lot of new functionality. One of these enhancements is that it automatically "pretty prints" SQL queries, adding line breaks and indentation to help the query become easier to read and to understand.
This is all well and good.
However, I have a few rather large and complex multi-table join queries intended to output specially formatted content for export to Microsoft Word. (For those curious, these include print-ready schedules for the prize lists for hunter-jumper equestrian competitions.) Some of the query fields are calculated, with chains of Immediate If conditions modifying the field's value based on various other field values. When accounting for all the fully qualified [query or table name].[field name] references, a few of these calculations might run up to 500 characters or so.
Well, Access has a limit of 1024 characters for any specific field in the Designer.
I found that after opening one of these queries in the Monaco editor and making any minor change, the query would no longer load in the Designer, triggering the Access 1024-character limit error. (Access helpfully does not tell you which field is too large either, haha.)
It turns out that by default the Monaco editor is using spaces for indentation, and the query is apparently saved in this formatted state. The character limit was being triggered by all the additional white space characters.
By right clicking in the SQL editor, I could open the editor's Command Palette, and found the command to convert all of the spaces to tabs. This solved the immediate issue in my case, but of course there are still quite a few tab characters added. I suppose it could mess with someone else's even bigger queries.
In any case, posting here as a heads up.
Edit: I may have posted my "solution" a bit too soon, haha. It seems that the editor wants to change everything back to spaces again the next time the query is opened, so the problem reappears. (My queries are already aliased to short abbreviations in the query design, so that isn't a way to save characters.)
In the latest version of Access I am using (MSO Version 2506 Build 16.0.18925.20076 64-bit), the Monaco editor has been enhanced to offer quite a lot of new functionality. One of these enhancements is that it automatically "pretty prints" SQL queries, adding line breaks and indentation to help the query become easier to read and to understand.
This is all well and good.
However, I have a few rather large and complex multi-table join queries intended to output specially formatted content for export to Microsoft Word. (For those curious, these include print-ready schedules for the prize lists for hunter-jumper equestrian competitions.) Some of the query fields are calculated, with chains of Immediate If conditions modifying the field's value based on various other field values. When accounting for all the fully qualified [query or table name].[field name] references, a few of these calculations might run up to 500 characters or so.
Well, Access has a limit of 1024 characters for any specific field in the Designer.
I found that after opening one of these queries in the Monaco editor and making any minor change, the query would no longer load in the Designer, triggering the Access 1024-character limit error. (Access helpfully does not tell you which field is too large either, haha.)
It turns out that by default the Monaco editor is using spaces for indentation, and the query is apparently saved in this formatted state. The character limit was being triggered by all the additional white space characters.
By right clicking in the SQL editor, I could open the editor's Command Palette, and found the command to convert all of the spaces to tabs. This solved the immediate issue in my case, but of course there are still quite a few tab characters added. I suppose it could mess with someone else's even bigger queries.
In any case, posting here as a heads up.
Edit: I may have posted my "solution" a bit too soon, haha. It seems that the editor wants to change everything back to spaces again the next time the query is opened, so the problem reappears. (My queries are already aliased to short abbreviations in the query design, so that isn't a way to save characters.)
Last edited: