Retrieving values from listview control

kenwarthen

Registered User.
Local time
Today, 06:47
Joined
Apr 14, 2008
Messages
35
I have a listview control on an Access 2007 form that displays four columns of information. The third column (CEU Cert Request) shows a Yes or No value for each record in the list. I want to create and email a pdf certificate for each record where the CEU column value is Yes, but can't figure out how to retrieve the records that meet this criteria. Any help will be greatly appreciated.

Ken
 
Try this aircode

For x = 0 to me.listbox.selected

If me.listbox(x,2) = "Yes" Then
your code here
End If


Next

What you are doing above is looping through all the items in the list box that
have been selected

Then the Me.Listbox(x,2) is reading the Index number of the listbox and the 3rd column (remember columns start at zero). So it is checking if the value in the third column is Yes, if so, do your thing, if not, don't bother.

I think the bit you were stuck on was the reading of the 3rd column.

Give it a go.

David
 
David,

Thanks for the help, but the control I'm working with is a listview ActiveX control, not an Access listbox.

Ken
 
Which ActiveX listview control are you using? Is it freeware or did you have to purchase it?
 
I'm using the Microsoft Windows Common Controls 6.0 (SP6) which uses mscomctl.ocx.
 
If my memory serves me correct you can use the

.CellText(nIndex,nColumn)

to examine the contents

David
 

Users who are viewing this thread

Back
Top Bottom