Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 7th, 2003, 08:48 AM
jayrye715 jayrye715 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 35 jayrye715 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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:

Reply With Quote
  #2  
Old July 7th, 2003, 10:02 AM
a_munro a_munro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 9 a_munro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old July 7th, 2003, 10:23 AM
jayrye715 jayrye715 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 35 jayrye715 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #4  
Old July 7th, 2003, 10:28 AM
a_munro a_munro is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 9 a_munro User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Im afraid I dont know about access, try using the help. I use it a lot and its got lots of examples.

Reply With Quote
  #5  
Old July 7th, 2003, 10:30 AM
jayrye715 jayrye715 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 35 jayrye715 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I am not using Access I am using an SQL Sever Database.
Well anyway Thanks for your help.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > move items from Listbox to listbox


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway