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

Multi-Column Combo Box Selection Help

Status
Not open for further replies.

jeffshex

Technical User
Jun 30, 2005
208
US
I need someone to point me in the right direction possibly here.
I have a 2 column combo box that holds the the value(ProgramID), but shows the name (ProgramName).
It's row source is to select from the programlist table the ID and Name only where Available = True.
That way the user can only select what's current and works just great.

The problem that I'm running into is that when a program is no longer available, the combo box is now blank. I'm guessing that's because the hidden value field won't display the name since it's being excluded from the row source now.

Anyone have any ideas around this or something?
I'd like the user to still see the program name in that field, but still only show available programs in the dropdown.
Thanks!
 
Add an invisible (visible property is no/false) combo box that shows all values. Name it cbo1 (or whatever).


Make a text box whose control source is...

Code:
=cbo1.column(1)

It will display the value in the second column of cbo1.

Size and position the text box over the combo box so
you can use the drop down arrow and the text box on top of the combo box (with the text box selected go to the format menu and select bring to front; or select the combobox and select send to back).
 
Ok,
So have 3 fields all together:
1. Combo box that lists all values
2. Text box that points to combo box w/ all values
3. Combo box that actually stores my ProgramID that is hidden behind the text box.

Does that sound right?
Just so I know, you are doing the textbox control source in code right? Access screws with the syntax if i type it in by hand into the textbox as =cboProList.column(1)
 
For clarity...


The combobox that shows all values is not visible.

Both comboboxes are bound or store the value... this is how the changes to the one combobox effect the other and thereby change the text in the combobox.

The combobox that IS visible shows current allowable values and is partially obscured by the textbox to the extent that it does not cover the drop down arrow.

And the control source for the textbox looks right. cboProList should be the combobox that contains all the values.
 
For some reason I think the preview button is where the submit button is for posts.... OOPS.

Both comboboxes are bound or store the value... this is how the changes to the one combobox effect the other and thereby change the text in the [red]TEXTBOX[/red].
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top