|
-
Jan 30th, 2007, 01:57 AM
#1
Thread Starter
Lively Member
Problem With Listview And Checkbox
can u guys help me with this code?
VB Code:
Dim itm As ListItem
For Each itm In lvList.ListItems
If itm.Checked Then
rs.Index = "JobNumber"
rs.Seek "=", lvList.SelectedItem.ListSubItems(1)
If Not rs.NoMatch Then
Call UpdateReport
MsgBox lvList.SelectedItem.ListSubItems(1).Text
Else
MsgBox "ERROR", vbCritical, "ERROR"
End If
Else
End If
Next itm
it does not work. can u help me gusys with this? thanks!
-
-
Jan 30th, 2007, 03:25 AM
#2
Re: Problem With Listview And Checkbox
-
Jan 30th, 2007, 07:57 AM
#3
Re: Problem With Listview And Checkbox
Is JobNumber the primarykey of the table? If not then use Find method instead, in criteria specify fieldname for match in the same manner you would create a criteria in an SQL WHERE clause.
-
Jan 30th, 2007, 12:00 PM
#4
Re: Problem With Listview And Checkbox
Try this
VB Code:
Dim itm As ListItem
Dim i As Long
For i = 1 To lvList.ListItems.Count
If lvList.ListItems.Item(i).Checked = True
rs.Index = "JobNumber"
rs.Seek "=", lvList.SelectedItem.ListSubItems(1)
If Not rs.NoMatch Then
Call UpdateReport
MsgBox lvList.SelectedItem.ListSubItems(1).Text
Else
MsgBox "ERROR", vbCritical, "ERROR"
End If
'Else
'if you are not going to do anything with the Else
'then you dont need it
End If
Next itm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|