Auto-populate comboBox with value from Row Source

  • Thread starter rsamoose via AccessMonster.com
  • Start date
R

rsamoose via AccessMonster.com

I am a novice to intermediate Access 2003 user with some VBA experience.

I have a form with 3 combo boxes. All three combo boxes have queries which
return a single column, as their row source.
Upon an update to the first combo box- the row source for the second Combo
Box is requeried based on the value from combo box 1.
Is it possible to have the (2nd) combo box display (auto-populate) the first
value of the resulting (re)query?

The drop-downs function correctly based on the queries. I am trying to avoid
the user needing to use the drop-down when only one value is returned from
the query.

I think I have a solution using recordsets- but have a hunch there is an
easier (probably built-in) solution.

Thank you for your time.
 
D

DrGUI

After you set the rowsource for Combo2, use the following:

Me.Combo2.value = Me.Combo2.ItemData(0)

This will post up to the first item in Combo2
 
R

rsamoose via AccessMonster.com

That is exactly the functionality I wanted.

Thank You.
Ryan
After you set the rowsource for Combo2, use the following:

Me.Combo2.value = Me.Combo2.ItemData(0)

This will post up to the first item in Combo2
I am a novice to intermediate Access 2003 user with some VBA experience.
[quoted text clipped - 13 lines]
Thank you for your time.
 

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