According to NAPA's online filter lookup, the Montana 3040 uses oil filter 1365, fuel filter 3262, air filter 6438 and hydraulic filter 1715. I have a Montana 2844, and all of the filters listed by NAPA for my tractor worked great.
When you look up P502067 under the competitor compatibility section, it shows compatible filters as 1365, 31365 and 41365.
Thanks so much for the NAPA link! Finally found an oil filter for my 3644HST. Bought the tractor used last year and time for some maintenance. Thanks again.