First, I have searched for an answer to this question but all searches have found answers to how to use a global variable in a query. I know how to do that.
What I want to do is create a query object which will call UseRates that are being calculated as data is changed - this is simple. The unknown answer is how to call this query (or input the results of this query) into a global variable such that the global variable definition would look something like (name of the query object is qryUseRates):
Public gUseRate1 = "SELECT qryUseRates.UseRate FROM qryUseRates WHERE lngAgeGrp = 1"
Then, of course define 4 more global variables similarly for the other 4 use rates (changing the where clause for each).
The reason: the use rates are calculated with all geographical areas aggregated but then they are applied to each geographical area separately. Thus, qryUseRates returns 5 rows but the query that uses these rates have close to 100 rows such that I don't see a way to join the 2 queries.
Just a follow up; Once the variable is defined I would do:
Public Function GetUseRate1()
getuserate1 = gUseRate1
Then go to a new query object and wherever I need it, I would use GetUseRate1(). When a global variable is properly defined, this seems to work - tried it just using something simple to define the global variable.