Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Components
|
VB Components Issues specific to components in VB.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2005, 03:35 PM
Authorized User
 
Join Date: Aug 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listbox problem (.Selected = True)

Hello,

I have a list box where I populate options, say
(1)
(2)
(3)
(4)

and I need to make vba select certain option (ie. say (2) and (4) dynamically) (list box is in multiselect: extended mode)

I have a loop that determines which option should be selected, but I cant seem to use the listbox.Selected(item) property to select specific options with vba. (there is no error, it just doesnt select the options I need it to select) Any Ideas?



code:
Code:
For intCounter = 0 To listCounties.ListCount - 1

            If (Val(listCounties.ItemData(intCounter)) = Val(countiesRecordSet.Fields(0))) Then

                listCounties.Selected(intCounter) = True

          End If

        Next intCounter

Thanks

ÐaÐeVi£
__________________
ÐaÐeVi£





Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox not showing correct selected value Shokwave ASP.NET 2.0 Basics 4 June 4th, 2007 08:23 AM
Deleting selected row in ListBox YoungFools Excel VBA 1 April 19th, 2007 09:14 AM
Set Listbox Selected property DaDeViL VB How-To 7 October 4th, 2006 04:04 PM
HELP: XSL -> HTML <select selected=true> jedbartlett XSLT 4 October 7th, 2004 11:16 PM
How to get selected Item from Listbox? Iceman571 ADO.NET 1 March 25th, 2004 06:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.