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!

Move Next/Move Previous

Status
Not open for further replies.

brews

Technical User
Dec 12, 2007
194
US
Trying to have the user be able to move alphabetically through a db in .net. The user picks a record from a listview and then:
Code:
        If frm.lvwDisplay.SelectedIndices.Count = 0 Then
            Exit Sub
        Else
            intID = CInt(frm.lvwDisplay.SelectedItems(0).Text)
            dataMgr.FindOneName(intID, nMember) 'nMember a class of members
            dataMgr.GetAbsRec(iID)
        End If

    Public Function GetAbsRec(ByVal iMemberID As Integer) As Integer
        Dim abspos As Integer
        Dim dtr As DataRow
        For i = 0 To ds.Tables("Members").Rows.Count - 1 ' this is where it falls apart. 'Object reference not set to an instance of an object.
            dtr = ds.Tables("Members").Rows(i)
            If dtr.Item("MemberID") = iMemberID Then
                abspos = i
            End If
        Next
        Return abspos
        Exit Function
    End Function
Once this hurdle is cleared, the data from the next record is displayed.

Any help is appreciated. thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top