Thank you very much, it is an option, but I wanted to do it through the class module.
However, thanks to your example, I have understood that the ribbon displayed is that of the form that is active, it does not matter if it is a main form or a subform. Therefore, I don't have to put...