Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MSForms Listbox

Posted on 2002-07-03
5
Medium Priority
?
289 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 53

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

610 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