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!

Combo Box Cascade add question

Status
Not open for further replies.

metrodub

Technical User
Dec 29, 2004
82
US
I have a form that has three cascading combo boxes. The first combo box contains a list of locations for our company (ie Boston, Tokyo, Los Angeles..etc), the second combo box contains a list of facilities at the chosen location (ie South St., Computer Dr., etc for Boston), and the third combo box contains a list of rooms used for meetings and/or training in the chosen facility (ie Conference Room, Patriots Room, etc for Computer Dr.).

The list of rooms that I have (some 800 total), surprisingly, doesn't contain every possible room. I have created a command button to open a new form to add a room and add it to the list of rooms.

My question: How can I code the form so that when I open the form and add a new room the data added to the rooms table will contain the appropriate Location ID (LocID) and Facility ID (FacID) so that the next time I want to choose that room it will fall under the correct Location and Facility?

I hope this makes sense.
 
If I've understood you correctly, one way to do this is to use Public variables.

Read about creating and using these, then move the relevant IDs into publics 'on click' of the command button, then read the contents of these publics into hidden text boxes on the input form - text boxes which are bound to the ID fields - 'on close' of the input form.

Hope this makes sense!

CSC
 
You lost me.

I declare the public variables:

Dim intLocID, intFacID as Integer

Then in the onClick function of the command button opening the new form I pass the variables to the hidden text boxes. Ok, I understand that...but how would I code that?

I have just recently started using VB and have a little Java experience, so while some coding makes sense to me...most of it doesn't.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top