tags:

views:

39

answers:

3

I am updating a MSAccess Database for 2010. When it runs a report it is displaying 2009 rather than 2010.

When in Design View I can see that a Control

=GetThisYearLong() is being called.

But where the heck is this function or whatever? is it code a query a bultin ??

where should I look? Thanks

+1  A: 

It's not a built-in function. It must be in the code of your database somewhere, perhaps in a code module? Or in an externally referenced DLL?

David M
When I view the code it just has a few simple functions. I guess there must be a "global" code module somewhere where can I find this?
zzapper
You can choose Alt+F11 to open the code window and then choose Edit->Find or ctrl+F to find code. Make sure you select Current Project.
Remou
It is also possible that a library has been added to References, check the references (Tools->References) for anything called *.mde or *.mdb or just anything unusual :)
Remou
I have been given notes from last year which state."Change This Year and Next Year in program to 2008/2009"This Year and Next Year are obviously global for the Database Application so where would they likely be declared?
zzapper
If it says This Year with a space between This and Year, I think it is likely to be a table. You can use ADO to find the table that contains these columns http://stackoverflow.com/questions/1851883/how-to-find-list-of-all-tables-in-access-database-matching-certaing-format-in-del
Remou
+1  A: 

Press Ctrl + G type in GetThisYearLong right click an say definition

There is your code

Andreas Hoffmann
Useful! char char
Remou
Or, once you've typed the function name, hit SHIFT-F2.
David-W-Fenton
Or, hit F2 in the VBE and type the function name in the search box and hit the binoculars.
David-W-Fenton
BTW, those who don't know these keyboard shortcuts might spend some time browsing the menus in the VBE, which give all these shortcuts right there on the menus beside the commands themselves.
David-W-Fenton
A: 

Hi sorry to answer my own question, but it may help somebody else:-

I went into view code on first screen (ie anywhere) and then selected "search current project" and it jumped me to a section called general this found:-

 Global Const ThisYear = 2009
 Global Const LastYear = 2008

 Public Function GetThisYearLong() ... 

So the answer for me was to select the option "current project" in the "find" dialog

Anyway thanks you got me there, and thanks stack overflow

phew!! I couldn't go home till I solved this

zzapper
"it may help somebody else" ... mhhhh ... not sure!
Philippe Grondier