Public Variable in Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have defined two public variables in a module: dtStartDate and dtEndDate.
I set the values of these public variables through a form.

My question is how do I access these variables from a Query. The query has
an expression that calls a function. The above variables are required for
executing the function.

Thanks in Advance
Anand
 
hi Anand,
I have defined two public variables in a module: dtStartDate and dtEndDate.
Is it a form or normal module?
My question is how do I access these variables from a Query. The query has
an expression that calls a function. The above variables are required for
executing the function.
You need a (or two) proxy function(s) returning the values. Place this
in a normal module:

Public Function GetDate(AStartDate As Boolean) As Date

If AStartDate Then
GetDate = dtStartDate
Else
GetDate = dtEndDate
End If

End Function


mfG
--> stefan <--
 
Back
Top