I thought you were laughing because he used Format(m,"0") in his CASE ELSE statement, while Format(date,"mmm") or Format(date,"mmmm") would have given him the results he was looking for in the first place.
Re^5: The joys of bad code
Replies are listed 'Best First'.
Well, this code has to be locale independent so I actually can sympathise with this approach. We normally deploy onto German Computers but we also end up on various others as well and the output has to be english regardless so I can see why he took this approach than figuring out how to override the users locale settings. (OTOH if you know an easy way to do it im all ears :-)
First they ignore you, then they laugh at you, then they fight you, then you win.
coupling is something I noticed. if you call *GetMonthName* and pass an arg for the month name, than another arg to abbreviate. The same effect could be obtained writing a formatting function, Format(GetMonthName(arg), "mmm") or even better as you suggest calling Date.
having the formatting within the function may be a short cut for now but I bet at sometime changes could be made introducing bugs.
its also pretty common trap to reimplement (usually poorly) functions that pre-exist.