You need to be more exact when you say "stopped" working.
When debugging, (and Before posting), always start by making absolutely sure that your code is run. You can look in our Access insights section for some articles on debugging in VBA, but a simply way for a "novice" is to simply add a msgbox preceeding the statement in question:
- MsgBox "About to turn off Ribbon"
-
DoCmd.ShowToolbar "Ribbon", acToolbarNo
The reason I bring this up, is that from what little information you have given, my best guess is that your code is simply not firing/executing.