The issue has to be with the actual value being passed. Put a break point on
Form_frmMain.fill_Tree True, Forms!frmMain.Form!Code.Value
and see what Forms!frmMain.Form!Code.Value
In fact ... try this instead:
Form_frmMain.fill_Tree True, Forms!frmMain!Code
mx