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

Global Variable as Query Criteria

Status
Not open for further replies.
May 5, 2002
79
US
I set a global variable based upon an employee logging into the system. I need to execute a form based upon a query. However, I need to limit the query results to the value of the global variable. How do I set the query criteria to the global variable so I only return the appropriate recordset?

Your help is appreciated.
 
Hi!

A global variable can't be used directly in the query, but might be retrieved thru a public function.

[tt]Public Function GetMyGlobal() as <Your datatype>
GetMyGlobal = MyGlobal
End Function[/tt]

Then just enter GetMyGlobal() in the criteria field in the query.

HTH Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top