Thanks for the reply.
the error is here:
Set mycontrol = menubar.Controls(MainItemName)
when this line of code is called:
Call AddMenuSubItem("Main Menu1", "&Batchs", "msoControlButton", "cap", 0, "=docmd.openform('frmcap')")
i corrected the mycontroll mistype ( thanks for spotting it )
i...