Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
VB listboxes
Name: black912star Date: March 3, 2005 at 16:16:32 Pacific OS: Windows 2000 CPU/Ram: N/A
Comment:
Hi guys,
I'm new to VB/VBA and my question is very simple (I hope). I have 2 listboxes in my Access form. Can anyone help me with a code for a button that moves items from the first listbox to the second one. My first list box gets it's data from a table.
Private Sub CopyList_Click() Dim item As String For i = 0 To right_list.ListCount - 1 right_list.RemoveItem (0) Next i For i = 0 To left_list.ListCount - 1 item = left_list.ItemData(i) right_list.AddItem (item) Next i End Sub
To do more requires more information about the source of the data from you.
0
Response Number 2
Name: StuartS Date: March 3, 2005 at 18:20:30 Pacific
Reply:
While the above code will copy the entire contents of List1 to List2, the following code will just copy selected items by double clicking on the item to be copied.
Summary: This one, though not extremely difficult, is a bit lengthy. Here's a simple example, albeit missing some pretty details: Option Explicit 'All on one line... Private Declare Function SendMsg Lib "user...
Summary: I have 'Up' and 'Down' buttons that I want to use to be able to scroll through the items in a listbox. When the currently selected item is at the top, the 'Up' button is disabled. I've done this by ...
Summary: Stuart, you are right! I should have given you a copy of the SQL instead of trying to retype it fast. I got the parameter thing resolved, but now another problem.... Using a listbox in a form and try...