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

Calling a public variable

Status
Not open for further replies.

balistikb

Technical User
Nov 12, 2002
177
US
I have declaired a public variable to hold a value that is selected from a pop up form combo box. I would like to use that value to filter the records that open in the next form. How do I reference back to that variable and how do I use that to filter a form?
Here is the code that I have to take the value from the combo box and put it in the variable.
Code:
Me.project.Value = project_name_str
[\Code]
 
Place the public variable in a global module and just refer to it anywhere in your project. You should probably load in a default value at the on_load of the switchboard or main form.

rollie@bwsys.net
 
Sorry I am still learning access but how do I call it if I want to use it?
 
As a global public variable, it can be set or called anywhere.

using a command button you could:

private sub command0_click()

msgbox MyPublicVariable



end sub

and it would be there.

rollie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top