|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
move items from Listbox to listbox
I have a form that contains 2 listboxes. When the form loads the first list box appears the users enter the information in to a text box and on enter that information is placed in the list. Below the list I have a command button the command buttons needs to be able to get the information from list one and be viewed in list 2. Here is the catcher though after the user enters the information the user will need to go back and select the ones needed to be moved. I have set the multiselect to true so that works but I need the ones selected to be moved to listbox2 on click.
Thaks in advance for any help you can provide.
__________________
Jay Rye :Cool: |
|
#2
|
|||
|
|||
|
heres an example to help, its from the VB help, under the forms reference.
[vb] Private Sub CommandButton1_Click() ListBox2.Clear For i = 0 To 9 If ListBox1.Selected(i) = True Then ListBox2.AddItem ListBox1.List(i) End If Next i End Sub [/vb] I hope this helps |
|
#3
|
|||
|
|||
|
Thank you for your help. I am having trouble writing this information back to an SQL database this information is entered by the user I have an update command button and it updates the recordset but I need to set this second list box to a datasource. Any Ideas how I could do this. The other info really helped thanks again.
|
|
#4
|
|||
|
|||
|
Im afraid I dont know about access, try using the help. I use it a lot and its got lots of examples.
|
|
#5
|
|||
|
|||
|
I am not using Access I am using an SQL Sever Database.
Well anyway Thanks for your help. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > move items from Listbox to listbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|