dynamic combo boxes

G

Guest

I am trying to filter the options of cboBox2 based on the results of cboBox1.
I know I have seen some sample databases out there with this functionality,
but can't seem to locate them now. If you know of a good example, please
share.

Problem, the results of this SQL is blank. It populates the row source of
cboBox2 fine, but no results. Can someone smarter than me help me out?

(These combo boxes are in a subform, calling the value of a combo box in the
subform)
Code in the after update event of cboBox1
********************

Me!cbo_cboBox2.RowSourceType = "Table/Query"

Me!cbo_cboBox2.RowSource = "Select Application from tbl_Application_List
Where Scope = '" & Me.cboBox1 & "'"

Me!cbo_cboBox2.Requery


*********************

The rowsource in cboBox2 after this code fires is
Select Application from tbl_Application_List Where Scope = 'Regression'

Your assistance is always greatly appreciated.

David
 
G

Guest

I have also tried removing the code of cboBox1 and have written this code in
cboBox2 row source.

Unfortunately, same result. No data populates in cboBox2 after cboBox1 has
data.

In cboBox2 row source...

SELECT DISTINCTROW Application FROM tbl_Application_List WHERE
(((tbl_Application_List.Scope) Like cboBox1));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top