criteria referencing a global variable

D

dchendrickson

I am using Access2002 / XP Pro.

I have developed a query that needs to use the value of a
global variable as one of its criteria.

My current approach is to place a function call in the
query criteria and have that function return the value of
the global variable.

Is this the recommended way to retrieve a variable or is
there syntax that will reference the global variable
directly? I tried [module_name]![global_variable_name] in
the criteria line, but that did not work.

It is working as I have it, so maybe I should leave it
alone, but I wanted to ask.

Thanks,

-dc
 
J

John Spencer (MVP)

You are doing it the way it needs to be done. There is no simple way to use a
global variable in a query.
 
D

dchendrickson

Thanks.
-----Original Message-----
You are doing it the way it needs to be done. There is no simple way to use a
global variable in a query.
I am using Access2002 / XP Pro.

I have developed a query that needs to use the value of a
global variable as one of its criteria.

My current approach is to place a function call in the
query criteria and have that function return the value of
the global variable.

Is this the recommended way to retrieve a variable or is
there syntax that will reference the global variable
directly? I tried [module_name]![global_variable_name] in
the criteria line, but that did not work.

It is working as I have it, so maybe I should leave it
alone, but I wanted to ask.

Thanks,

-dc
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top