Results 1 to 2 of 2
2005-05-16, 17:35 #1
- Join Date
- Dec 2002
- Kitchener, Ontario, Canada
- Thanked 0 Times in 0 Posts
Efficiency in calling a value (2000 SR3)
I have a parameter form which I use to select a value to filter a report. This form used the procedure (rptPhoneBook example) from Access 2000 Developer's handbook, one of the features of which is that it uses a constant for the report name and calls on the constant to open the report.
I now have two slightly different reports that I want to be able to use the same form for choosing values and an added field for choosing which report to print. One is for local use and the other with less detail for submission to the regional body. I discovered in the course of working through this that constants (of which I had given little thought previously), are just that, constant and can't be changed on the fly. I created a workaround by getting rid of the constant and using a function with the same name as the constant to call the report name. This meant I didn't really have to rewrite anything and only had to create a very simple function.
So, here's the question: Is there a more efficient way to do this? I noticed that the function gets called several times in the process. Is there a way to get the name stored for the duration of the various procedures and not called each time the next little procedure is run? It doesn't seem to slow things down appreciably it's more a question of is this the best way to do it.
2005-05-16, 17:58 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Efficiency in calling a value (2000 SR3)
The function is very simple, so the overhead of calling it is small, so I don't think there is any objection to using it.