Solved

How do you load items from a listbox into a variable?

Posted on 2009-07-07
3
166 Views
Last Modified: 2012-05-07
How would I load the contents in my listbox into a variable?
0
Comment
Question by:Taylor814
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
lppperes earned 500 total points
ID: 24800410
You can do something like this:

Dim i as Integer
Dim myVar as String

For i = 0 to ListBox1.ListCount - 1
    myVar = ListBox1.List(i) & ";"
Next
0
 

Author Comment

by:Taylor814
ID: 24800448
I had to add:

myVar = myVar & ListBox1.List(i) & ";"
0
 
LVL 2

Expert Comment

by:lppperes
ID: 24800499
Sorry about that.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

734 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