Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto selection for list box in form? 1

Status
Not open for further replies.

Bretcutler

Technical User
Jan 5, 2001
14
US
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
 
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
 
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.
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top