This is related to teh earlier post on generating Quarterly date ranges on-the fly. I wrote some code in a module that takes an input (EnterYear) and produces the required quarterly ranges. I've never tried to make a function, so I'm a bit puzzled as to how I can access my code now that I've written it.
I have got to this point:
and can click on the run button in VBA and, since I have an input box in the code, it pops up to accept a year and displays the quarters. Groovy. HOWEVER, when I try to do RunCode in a macro (just to see if it'll run) I get 'The expression you entered has a function name that Access can't find'. I thought, well, perhaps I should put something in the () of the function declaration, like (EnterYear) [the name of the variable] -- so I do that and when I click on thr run button in VBA, the Macros dialog box pops up with no macros listed. I tried creating one called Quarters but it says the name conflicts with an existing module, project or library.
OK, don't understand that. I go back to the Macro, do RunCode and type in Quarters(2000) and the same 'The expression you entered has a function name that Access can't find' error shows up.
OK, no progress. I go back to VBA and try Quarters(EnterYear as Integer); no progress. The only thing that I can do is delete the () content and the function runs in VBA but no where else.