By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,929 Members | 1,284 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,929 IT Pros & Developers. It's quick & easy.

Select only item in dropdown box

P: n/a
Hi,

I ahve an issue that I could tackle myself. sometimes a dropdown box
is filled with only one element. How can I set this dropdown box to
auto-select this one option?

So in VB. If my listcount of a dropdown element is 1 how do I capture
the value of this element and set the dropdown box to show/select this
one element? (instead of showing empty)
Thx, Sean
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
DFS
"seansan" <se*****@reeve.nl> wrote in message
news:cd**************************@posting.google.c om...
Hi,

I ahve an issue that I could tackle myself. sometimes a dropdown box
is filled with only one element. How can I set this dropdown box to
auto-select this one option?

So in VB. If my listcount of a dropdown element is 1 how do I capture
the value of this element and set the dropdown box to show/select this
one element? (instead of showing empty)


In the Form_Open event, add this line:
If me.listBox.listCount = 1 then me.listBox = me.listBox.itemData(0)

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.