Solved

MSForms Listbox

Posted on 2002-07-03
5
267 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
[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
  • 3
5 Comments
 
LVL 52

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 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