Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing row from listbox where column not null

Status
Not open for further replies.

Bobnz

IS-IT--Management
Aug 19, 2002
116
NZ
Hi, I have a listbox that is populated via a query based on a user selection, this list box can contain up to 30 records/rows. What I want to do is select multiple rows (Multi select is on) and print them but only if certain columns/fields are not empty.

B
 
You can use the Column property to examine the contents of a column in a listbox. Like this

ListBoxName.Column(Index, Row)

Index is the zero based column number

Row is the optional zero based row number

ListBoxName.Column(1, 4) will return the value from the second column fifth row.
 
Here's how you would loop thru the items selected.

Dim varItem as Variant

For Each varItem In lstMyListBox.ItemsSelected
MsgBox lstMyListBox.Column(0, varItem)
Next varItem
 
Thanks for the replies, lollipop to FancyPrairie.

B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top