Solved

Listbox

Posted on 1998-08-15
1
148 Views
Last Modified: 2010-04-30
Do you Know How to make it so there are like 2 list boxes and when you click on a Item in list1 it shows only there Msgs in list2
0
Comment
Question by:Scorpion2000
1 Comment
 

Accepted Solution

by:
mwam earned 10 total points
ID: 1429095
there may be better ways to do this but it works:
'---------start code-------------
Private Sub Form_Load()
List1.AddItem "this string"
List1.AddItem "that string"
List1.AddItem "this and that string"

End Sub

Private Sub List1_Click()
List2.Clear

For i = 0 To List1.ListCount - 1
If List1.Selected(i) = True Then List2.AddItem List1.List(i)

Next
End Sub
'------------------end code-----------------
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question