Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reference global consts in SQL 1

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
0
0
GB
Hello all

I'm wondering if this is possible at all but I've declared a
global const blah as integer = 111
in a module called consts

and I'm wondering if I can reference it directly from a Query.

So far, the query doesn't give an error for
[modules]![consts]![blah]
however it doesn't actually pull up the value, and will empty anything else in the field if concatenated with something else...

Thanks

--------------------
Procrastinate Now!
 
I added a function:

Function GetBlah()
GetBlah = blah
End Function

Then called that in the query.

GetBlah()

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
I see, good idea...

so there's no way to directly reference that global constant?

--------------------
Procrastinate Now!
 
In modules/code there is.

An option is to make a table, and store the number in there. Then reference it in queries and such either by putting the table into your query, or by using DLookup:

Dlookup("Blah","TableName")

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top