×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Auto selection for list box in form?

Auto selection for list box in form?

Auto selection for list box in form?

(OP)
I have managed to get everything working from my previous post....  I can't however get the forms list box to automatically select the control number in it.  There is only one number in the list box, and the list box is named "list0"...  I need it to automatically highlight this control number in order to have it print automatically and then it will be removed from the to be printed list by the macro i have already.  I would guess this is another VB question but am not sure.  So to sum up, I need to have the list box in my form automatically come up highlighted so that the rest of my automatic stuff works... thanks alot,
Bret

RE: Auto selection for list box in form?

List0.Selected(0) = True

0 is the first item in the list
1 is the second and so on.

DougP, MCP
 dposton@universal1.com
 
 Ask me how Bar-codes can help you be more productive.
 Or visit my WEB site www.barcodeone.com

RE: Auto selection for list box in form?

(OP)
This actually works only partly.  It is odd.  It shows up as selected but doesn't work unless you click on it.  It is showing selected but acting like it isn't selected.  I am not sure why or how to fix this.  I have been playing with it in order to try to get it to work but to no avail.  If you have anymore ideas please let me know and thanks for the help.  This is the last step and it is frustrating because it looks as though it is going to work and then it does nothing which is what it is set up to do if nothing is selected.  

RE: Auto selection for list box in form?

(OP)
This actually works only partly.  It is odd.  It shows up as selected but doesn't work unless you click on it.  It is showing selected but acting like it isn't selected.  I am not sure why or how to fix this.  I have been playing with it in order to try to get it to work but to no avail.  If you have anymore ideas please let me know and thanks for the help.  This is the last step and it is frustrating because it looks as though it is going to work and then it does nothing which is what it is set up to do if nothing is selected.  \

Thanks alot for any help you can offer

RE: Auto selection for list box in form?

i ran into this one too...

i found that you also have to set the value of the control as well as set the listBox.select flag to true

for a list box i did (works just fine)

Me.ListBox.Value = Me.ListBox.ItemData(0)

also note that for comboBoxes it's different notation but the same idea... i can't recall just now ...

hope this helps

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close