Select Item in ListBox based on Control Value

MarkA70

Registered User.
Local time
Today, 12:11
Joined
Jan 30, 2016
Messages
43
I have a listbox with Column 0 set to a Primary Key. I would like to use a combo box to select a value with the Bound Column of the Combo Box being the same Primary Key as the Listbox. How do I get the Listbox to show the row of the Combo Box's value?
 
the list box query will use the combo box as its criteria.
lstbox.rowsource = "qsDataByCombo"

qsDataByCombo.sql = Select * from table where [key] = forms!frmForm!cboBox

Then when the user changes the combo, be sure to refresh the listbox in the AFTERUPDATE event.

Code:
 sub cboBox_Afterupdate
   lstBox.requery
 
You could try:
Code:
Me.NameOfListBox= Me.NameOfComboBox
 

Users who are viewing this thread

Back
Top Bottom