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!

Selecting records in a listview control 2

Status
Not open for further replies.

AndrewdB

Technical User
Dec 3, 2009
1
ZA
Hi All. I'm using a listview control on a form in Access2007 to show multiple records. The reason I'm using a listview is so that I can show icons representing the status of each record. After the user has selected 1 or more records in the listview control I want him to click on a button to update all those records. I have multiselect set to Yes. I am struggling with the code for the button.
The code has to run through all the selected records and post a value into the recordset.

Thanks for any help.
AndrewdB
 
Private Sub cmdGetItems_Click()
Dim li As ListItem
Dim lvw As ListView
Dim strLi As String
Set lvw = Me.lvwOne.Object
For Each li In lvw.ListItems
If li.Selected Then
'run update query here
End If
Next li
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top