Solved

MSForms Listbox

Posted on 2002-07-03
5
251 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 49

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

760 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

23 Experts available now in Live!

Get 1:1 Help Now