Solved

MSForms Listbox

Posted on 2002-07-03
5
259 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 51

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Record with #Error 8 34
Syntax error with Dates where clause 10 50
ERROR 3113 MODULEID NOT UPDATABLE 8 21
how to insert parameter value in table 2 23
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

821 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