473,666 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Selection in Listbox when Edit the form

Hi,
I have form where i am using a listbox where we can select multiple values.I
am storing the selected values concatenating with commas(for eg.
"22,21,19,16"). Now i have to update this form, so i have to retrieve these
values and to hightlight the previously selected values.

If HcbTypeRecordsO ld(i) <> "" Then 'HcbTypeRecords Old(i)
values from the database is "22,21,19,1 6"
If Split(HcbTypeRe cordsOld(i), ",").Length > 1 Then
'Checking for multiple selection
Dim j As Integer
For j = 0 To Split(HcbTypeRe cordsOld(i),
",").Length - 1
Dim
strSelectedValu e(Split(HcbType RecordsOld(i), ",").Length ) As String
strSelectedValu e =
Split(HcbTypeRe cordsOld(i), ",")
Dim iSelectedIndex As Integer
iSelectedIndex =
Convert.ToInt32 (strSelectedVal ue(j))
cbTypeRecords.S electedIndex = iSelectedIndex
Next
Else
cbTypeRecords.S electedIndex =
Convert.ToInt32 (HcbTypeRecords Old(i))
End If
End If
How to set all the values as selected? Now "16" only set as selected.

Thanks
Kumar

May 4 '06 #1
0 1101

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2559
by: DK | last post by:
Hello everybody ! I need little help from Your side. I have form called Form2, and ListBox called List 20. Property of List 20 allow multiple selection. Also I have query called Distribution as mail merge source.I need to control query Distribution to send letters to people selected in List 20. When I use List20 control without multiple selection everything is OK. Single letter is printed. Thank You in advance for Your help
2
2267
by: Peter | last post by:
Hello! Please, could anyone tell, is it possible to set multiple items to be selected in list control in the code? For example when the web form is loaded three items of 5 are selected in list control already? Now I manage to set only one item to be selected during page load, but there is need to multiple items could be selected for the user. I appreciate very much your help! Thanks.
5
3525
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all selected items of that listbox and display it. can anyone help? Thanks
2
5126
by: billa856 | last post by:
Hi, My Project is in MS Access. In that I have one form in which I have some textboxes,comboboxes and listboxes. Now when I select value from 1st combobox(CustomerID) then it wil generate list for 1st listbox(PalletNo). Now I want to select miltiple values from that 1st listbox(PalletNo). and based upon this selection from 1st listbox(PalletNo) and combobox(CustomerID) I want to generate list for 2nd listbox(PONo). For example ...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.