Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Listbox


Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2001, 08:53 PM
The Cleaner
Guest
 
Posts: n/a
Default Listbox


how do you add items to a list box in Access?

(the lstName.Additem "wow", indexvalue in VB)

"A movement starts here and ends there. But a revolution keeps going around and around."
Reply With Quote
  #2  
Old 08-24-2001, 09:05 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: Listbox

You have to use the RowSource property of the Listbox. First, you need
to set the RowSourceType = "Value List". Then you can assign the
RowSource, separating the lines with a ;
List0.RowSource = "'Line1';'Line2';'Line3'"

I think therefore I am... sometimes right. [img]images/icons/wink.gif[/img]
__________________
Posting Guidelines
Reply With Quote
  #3  
Old 08-24-2001, 09:50 PM
The Cleaner
Guest
 
Posts: n/a
Default Re: Listbox

OK, got it. thanks

how would one go about having a list box being sorted automatically.... alpahbetically? I don't see it in the control properites

"A movement starts here and ends there. But a revolution keeps going around and around."
Reply With Quote
  #4  
Old 08-24-2001, 10:47 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: Listbox

I can't find a way to sort an unbound listbox (with values supplied to
the rowsource.) With a listbox that comes from a query, the sort is part
of the query. Sorry

I think therefore I am... sometimes right. [img]images/icons/wink.gif[/img]
__________________
Posting Guidelines
Reply With Quote
  #5  
Old 08-24-2001, 11:14 PM
The Cleaner
Guest
 
Posts: n/a
Default Re: Listbox

OK.... thats what i thought. I guess you would i have to do it programmatically. Thanks for the help



"A movement starts here and ends there. But a revolution keeps going around and around."
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->