How do you Pass a Global Variable to a query (1 Viewer)

ChampionDuy

Registered User.
Local time
Today, 05:51
Joined
Mar 14, 2002
Messages
94
IS there a way to pass a global variable into a simple select query?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:51
Joined
Feb 19, 2002
Messages
43,371
You need to create a function to do it.

Public Function YourFuncName()
YourFuncName = someGlobalVariable
End Function

Then in the query:

...
Where YourField = YourFuncName();
 

ChampionDuy

Registered User.
Local time
Today, 05:51
Joined
Mar 14, 2002
Messages
94
I created a Function

public Function EndDateFun()

EndDateFun = EndingDate

End Function

then in my query I put

Where ExpDate >= EndDateFun


and I got a error message saying that the Function was identified or could not find function.
What am I doing wrong? I would appreciate any help Sorry for the long Delay in response
 

Users who are viewing this thread

Top Bottom