Howto make Combobox requery based on dependant combobox values

  • Thread starter Thread starter Shane
  • Start date Start date
S

Shane

I'm trying to make a form that has two combo-boxes. One displays the field
list from my table, and the other is supposed to requery to show only values
from that field. However, I can't figure out what code to use.

I want it to be something such as:
SELECT tblIP.[Me.cboSearch.Value] FROM tblIP;

Where tblIP is the table and cboSearch is the field-list combo-box. Of
course that statement doesn't work, but how would I implement this? Please
be aware that the first combo-box displays the "field-list" and not values
from the table. Would I have to create a separate table to have just the
fields listed as values?

Shane
 
Shane said:
I'm trying to make a form that has two combo-boxes. One displays the
field
list from my table, and the other is supposed to requery to show only
values
from that field. However, I can't figure out what code to use.

I want it to be something such as:
SELECT tblIP.[Me.cboSearch.Value] FROM tblIP;

Where tblIP is the table and cboSearch is the field-list combo-box. Of
course that statement doesn't work, but how would I implement this?
Please
be aware that the first combo-box displays the "field-list" and not values
from the table. Would I have to create a separate table to have just the
fields listed as values?

Shane


In the AfterUpdate event procedure of the first combo box ...

Me.NameOfSecondComboBoxHere.RowSource = "SELECT tblIP.[" &
Me.cboSearch.Value & "] FROM tblIP"
Me.NameOfSecondComboBoxHere.Requery
 
Back
Top