Synchronized Combo Boxes

G

Guest

The first item in the dropdown list apears automatically in my dependent
combo box. I want the box to stay null until the user clicks on the dropdown
and selects an item from the list.

How do I do that?

Thanks!
 
G

Guest

Leave the rowsource empty for the combobox and set it in the On_Enter
property, eg;
me.cboMyComboBox.Rowsource = "SELECT * FROM tblMyTable WHERE.........."

TonyT..
 
G

Guest

The rowsource of the dependent ComboBox is set in the AfterUpdate event of
the primary ComboBox. Because the WHERE clause is dynamic, I am unclear as
to what I am supposed to do.

Could you please clarify?

Thanks!
 
G

Guest

All of the values / variables used in the after_update event of the 1st
combobox should be available to you in the on_enter event of the second
combobox, so you should literally be able to copy and paste the code from the
after_update sub of combobox1 to the on_enter event of combobox 2, thus it
stay blank until the user enters into it, then it displays the 1st line.

The other route is to create a union query with " " as an alias entry to the
1st visible combobox field set to be the first item of the rowsource. The
main downside is that you then have to code around the user actually
selecting " " or leaving it *blank* (it is no longer truely blank).

TonyT..
 
G

Guest

Now I get it. Thanks, TonyT!

KADL

TonyT said:
All of the values / variables used in the after_update event of the 1st
combobox should be available to you in the on_enter event of the second
combobox, so you should literally be able to copy and paste the code from the
after_update sub of combobox1 to the on_enter event of combobox 2, thus it
stay blank until the user enters into it, then it displays the 1st line.

The other route is to create a union query with " " as an alias entry to the
1st visible combobox field set to be the first item of the rowsource. The
main downside is that you then have to code around the user actually
selecting " " or leaving it *blank* (it is no longer truely blank).

TonyT..
 

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

Similar Threads


Top