Me said:
Is there any way by which I can pass a public variable value to
a query?
I have a form with Public variable as -
Public myqueryvar as String
I would like to use this variable in my query
Thank you,
-Me
Hi Me!
What, exactly, are you trying to do? Are you setting up a form into which you
can type or select of parameter which is then used in your query?
If so, what I do is set up the form with a text box or a self populating
combo box (whatever) and then add a button to run a query or a report based
on a query. You then refer to the form's control as your selection criteria
in the query.
For example, say you want to produce a report/query based on people who are
male.
Create a form, say, frmMySelection with a text box (txtGender).
In the query's criteria you insert [Forms]![frmMySelection]![txtGender] into
the Gender column.
Hope this helps.
Kind regards
Tony