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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global Variables

Status
Not open for further replies.

tdfreeman

MIS
Mar 28, 2002
85
US
Can you reference a global variable as part of criteria in a query? If so, how do you do so? I am trying to do so and it is not working. I tried using expression builder but it does not find the variable.

Thank you in advance for your help.

Tammy

Thank you for your help.

Tammy
 
I usually create two functions, one to set the value from anywhere and one to retrieve the value from anywhere.

Public PubVar As String

Public Function SetPubVar(ByVal someval As String)
PubVar = someval
End Function

Public Function GetPubVar() As String
GetPubVar= PubVar
End Function

If your code:

Call SetPubVar(SomeNewValue)

In your criteria put the GetPubVar() function call.








 
Thanks. This is actually what I figured out after I posted this request.

I created a public function to assign the value to that function and return it in the query.

Thank you for your help.

Tammy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top