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

Hold the value of a combo box?

Status
Not open for further replies.

balistikb

Technical User
Nov 12, 2002
177
US
I have a form that opens up automatically when the database is opened. On this form I have a combo box that the user will have to select their project that they are working on. Is it possible to store the project name that they selected so I could use that to auto fill other areas. Like certain areas of other forms and the type of reports that can be viewed.
Please Help
 
In a module declare a public variable

EG

Public project_name_str as string

When the user has selected a project from the list use this after the on update or on click if you have a button ...

me.combobox.value = project_name_str

Tiny

Perfection is Everything
If it worked first time we wont be here!
 
Hi,

Waht other areas would you like to fill? i.e how many? on how many forms.

waht are the names of you forms and combo box?
 
That sounds good, so then when I want to use the value that is stored in that variable I just call the name?
Like in a new form text1= project_name_str
 
Well the next step after they pick their project name from the combo box is to open the next for which will allow them to enter a new issue. In that form I want a text field called ProjNam to be automatically filled in with their previous choice. But also, I would like to use that choice in a filter. Example, when they are entering information on the second form I would like them to only see any other records that are also the same project name. (filter)
I hope this makes sense.
 
Hi,

I don't think you need global variable at all for this.

why not do this

dim str as string

str = combobox
docmd.openform "myform",,field = str
 
With this solution, will it also filter my records?
 
I am still stumped on this, can anyone please help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top