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

Multiselect list box

Status
Not open for further replies.

tar28un

Technical User
Nov 29, 2005
58
0
0
GB
Hi there,

I have a form which has a multiselect list box. now the rows in the multiselect list box are filtered from a table based on a parameter. Now that is working fine.

Now i want to filter the data further and want to have two parameters instead on one.

the first parameter value is given by user when it runs, so that works perfectly fine.
the second parameter value is stored in a variable. I have made that variable public and declared it in the General declaration section.

what I want to know is how I can let the query check for that variable value.

So for example From a very big student table I am trying to fetch students records based on thier school no. and term.

School no. will change every time so it will be entered everytime but i dont want term to be reentered each time as it will remain the same for that particular term.

I also dont want to specify the specific term in the query as it will change each term. So i want the user to specify the term when he logs in and put that value in a public variable and let all the queries use that public variable.

I have tried to explain what I want

Can somebody help

many thanks
 
You can create a public function to return the variable value.

Public Function GetMyValue()
GetMyValue = MyPublicVariable
End Function

MyPublicVariable of course if your public variable.

In your query you can put GetMyValue() as the criteria for the column in question.

Hope that helps.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top