G greghedberg Apr 5, 2004 #1 Is it possible to reference a global Variable defined in a module within a query.
B Brian Camire Apr 5, 2004 #2 Yes, indirectly through a function. For example, if you had a global variable defined in a module that looked something like this: Public YourGlobalVariable As String you might create a function in the same function that looks something like this: Public Function YourGlobalVariableValue() As String YourGlobalVariableValue = YourGlobalVariable End Function You might then use this in a query like this: SELECT [Your Table].* FROM [Your Table] WHERE [Your Table].[Your Text Field] = YourGlobalVariableValue()
Yes, indirectly through a function. For example, if you had a global variable defined in a module that looked something like this: Public YourGlobalVariable As String you might create a function in the same function that looks something like this: Public Function YourGlobalVariableValue() As String YourGlobalVariableValue = YourGlobalVariable End Function You might then use this in a query like this: SELECT [Your Table].* FROM [Your Table] WHERE [Your Table].[Your Text Field] = YourGlobalVariableValue()
A Andrew Smith Apr 5, 2004 #3 Not directly, but you can create a public function that returns the value of the variable, and use the function in the query.
Not directly, but you can create a public function that returns the value of the variable, and use the function in the query.