Public Variable in Query

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
 
S

Stefan Hoffmann

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 <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top