473,399 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Create ListBox programatically

10
Hi Guys,

is it possible to create an instance of ListBox programatically?
Actually I have two issues here:

1.)
When I type this line in Access 2003:
Expand|Select|Wrap|Line Numbers
  1. Dim tmpList As ListBox
  2. Set tmpList = New ListBox
Access' run-time compiler changes the "ListBox" name to "listbox" (lowercase):
Expand|Select|Wrap|Line Numbers
  1. Dim tmpList As listbox
  2. Set tmpList = New listbox
2.)
When the second line is executed the tmpList remains set to "nothing".

What am I doing wrong?
Thanks a lot.
juing
May 6 '09 #1
3 6343
ADezii
8,834 Expert 8TB
@juing
To the best of my knowledge the The New keyword can't be used to declare instances of dependent Objects. What exactly are you trying to accomplish?
May 6 '09 #2
juing
10
@ADezii
I want to create instance of the ListBox class for temporary purposes.
What are dependent Objects ?

I temporarily solved this by adding ListBox component to one of my forms and made it invisible. And I use its object as a temporary listbox for storing data.
May 6 '09 #3
ADezii
8,834 Expert 8TB
@juing
I want to create instance of the ListBox class for temporary purposes.
What are dependent Objects ?
In the case of a ListBox, it is essentially dependent of the Form on which it is contained. I'm referring to a Parent Object.

P.S. - You can also create a ListBox programmatically via the CreateControl() Method. This will basically be a New ListBox altogether and not a New Instance of the ListBox Class.
May 6 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: pintihar | last post by:
Hi, As a follow on from an earlier post I have another question about xslt. Is it possible to create the stylsheet programatically? Is this sensible? In the first phase I needed to map element...
5
by: ColinWard | last post by:
Is there any way to skip lines programatically within a listbox as there is in a textbox? I have a listbox on a form which gets populated with the attachments I want to send with an e-mail but they...
1
by: ColinWard | last post by:
I have the following loop which goes through and adds items to a listbox. the items have been selected by the user from a file open dialog. Right now all that shows up is the filename. I would like...
6
by: AAJ | last post by:
Hi all I have a listbox on a form. If I set its rowsource directly, and the query in the rowsourse returns no data, then the displayed listbox is empty (exactly as you would expect) ...
2
by: tangokilo | last post by:
Hello and thanks for your help, I have the following Listbox created in VisualStudio 2003 designer, desiring to select multiple entries from that list: -------------------------------...
1
by: eric | last post by:
Hi, Can anyone please explain to me how I can cop selected items from a multi listbox(simple) to another multi listbox? the code I found on msdn only seems to support single column copies, i...
3
by: Prochot | last post by:
I'm trying to design a database to track projects and the associates assigned to them. I have almost no experience with this. I have three tables: -Projects -Associates -Assignments where...
6
by: tommcd24 | last post by:
Hello all, I need a way to read a previously saved list of customers and programatically "Select" these items in an existing listbox. Something to the effect of ListBox.SelectedItems =...
7
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.