Solved

MSForms Listbox

Posted on 2002-07-03
5
254 Views
Last Modified: 2007-12-19
is there a way to use the following code in MSAccess97

listbox.additem "foobar"
listbox.itemdata(listbox.newindex)=2

(in VB the property newindex can be set, but  Access dosn't support this property)

is there another way  ?

thanks for your suggestions
0
Comment
Question by:A563218
  • 3
5 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 7126392
Try RowSource Property

List1.RowSource = List1.RowSource & ";" & "foobar"
List1.Refresh

You can try ListCount instead of NewIndex ?
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7126565
The value list will work but it's limited by it's max stringsize...

Personally I prefer to use a (temp) table and link the listbox top the table, using:
currentdb.execute ("INSERT INTO tblListbox (item) VALUES ('footbar'")

This also will enable a sort sequence..

Nic;o)
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7126569
ops, read:

Personally I prefer to use a (temp) table and link the listbox top the table, using:
currentdb.execute ("INSERT INTO tblListbox (item) VALUES ('footbar'")
to "replace" the .additem

Nic;o)
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7254441

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7269998
Per recommendation, points NOT refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
access pop-up form 3 30
Auto-generated ID's in MS Access 9 42
Access: Retrieving Current Month's Orders for Invoice 6 25
SQL multicriteria from ONE textbox 32 41
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

813 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now