Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 10:30 AM (PST)
Microsoft Tech Community
LIVE
SOLVED

Northwinds 2.0 template Help

Copper Contributor

Is there anyplace/anyone who can provide some basic help with the new Northwinds 2.0 Developer version of the template? I'm specifically looking for some guidance modifying the customized ribbon. I've made some minor changes to labels, etc. that all work but I CANNOT seem to add an additional button in the 3rd group (Maintenance). When I copy-and-paste the lines for the last button, change the button ID and the label and reload the XML into USysRibbons and suddenly the ribbon won't load. ANy suggestions? Am I corrupting the XML file when I add lines?

5 Replies

I'm one of the creators of NW2.
What I do is create a new form bound to USysRibbons, so I can easily replace the XML.
I always make a backup first, because (as you found out) it is easy to break things. The XML is case sensitive and VERY picky.
I copy the XML to a text file (I use Notepad++ with an XML add-in, and I save the file as "ribbon.xml" so I get syntax highlighting), and edit it there; not in the above mentioned form - that is just for copy/paste.
Editing xml is mostly a matter of copy/paste an item.
Same thing for the callback functions in modRibbonCallbacks: VERY picky.
Once you are more comfortable, this web site is the one I use for all the finer points of the XML: https://www.accessribbon.de/en/

@Tom_van_Stiphout Thank you VERY MUCH for the quick response! I've been working with Access almost from the beginning and I'm always on the lookout for a good template for apps I build and maintain. I think I've done everything you suggest except that I use PSPad as my editor and I've been saving my working code in a TXT file, rather than XML. But I make the mods in the editor and then copy-paste them into the memo field of the USysRibbons table in the database. I will try renaming the text file to XML and letting my editor syntax check it to see if that turns up anything. I also wonder if working directly in the table might be causing an issue? When it "breaks", the app opens, asks me to log in and then goes to the Orders screen, as expected, but the ribbon doesn't change (it remains the default one). There are no error messages, but I assume the XLM code "failed" when loading? Using the same editing process to remove the 5 lines of added code for the new button seems to fix things.

 

Thanks again, a thanks to the entire NW2 team for a great template.

best response confirmed by BajaRic2009 (Copper Contributor)
Solution
Thanks for the thanks. I will pass it along. Stay tuned; v2.2 is not too far away. Also note the videos that have been posted on YouTube. The team has already discussed many aspects of NW2 and several recordings are available.

> I also wonder if working directly in the table might be causing an issue?
Yes. That is why I am using a text editor. The Access built-in textbox definitely has issues with larger XML formatted files. I never edit directly, nor in the textbox on frmSysRibbons.
Well, I have to say "Thanks!" one more time. I renamed my text file to XML, opened it with PSPad, made the same cut-and-paste changes I had already tried a dozen times, copied the modified text into the memo field (after deleting the existing text), closed the USysRibbons table, closed the database, reopened it and BINGO! the new button I've been trying to add was there! Someday I'd like to know the "why" of all that, but for today I'll take working code as a win!

Problem solved!

To turn on or off the XML error reporting when you open your Access app with ribbon, use this registry key - Thanks to Gunter Avenius:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Common\General]
"ReportAddinCustomUIErrors"=dword:00000001
Or
"ReportAddinCustomUIErrors"=dword:00000000
1 best response

Accepted Solutions
best response confirmed by BajaRic2009 (Copper Contributor)
Solution
Thanks for the thanks. I will pass it along. Stay tuned; v2.2 is not too far away. Also note the videos that have been posted on YouTube. The team has already discussed many aspects of NW2 and several recordings are available.

> I also wonder if working directly in the table might be causing an issue?
Yes. That is why I am using a text editor. The Access built-in textbox definitely has issues with larger XML formatted files. I never edit directly, nor in the textbox on frmSysRibbons.

View solution in original post