MoveNext method
Sets the current record of the record set to the next record. If the current record is the last record, it is set to the position after the last record (and the EOF property of the Recordset object becomes True). Calling the MoveNext method while the EOF property is True results in an error.
Applies to
Objects: Recordset
Syntax
object.MoveNext
Parameters
Part | Description |
---|---|
object | Required. An expression that returns a Recordset object. |
Example
Sub TraverseRecordset()
Dim objApp As New MapPoint.Application
Dim objRS As MapPoint.Recordset
objApp.Visible = True
objApp.UserControl = True
'Query to obtain all records in the record set
Set objRS = objApp.OpenMap(objApp.Path & "\Samples\Sales.ptm").DataSets(1).QueryAllRecords
'Add values for all records
Dim dTotal As Double
Do Until objRS.EOF
dTotal = dTotal + CDbl(objRS.Fields("Our Sales ($)").Value)
objRS.MoveNext
Loop
MsgBox "Total Sales: " & Format(dTotal, "$#,###,###.00")
End Sub
Note This sample code contains data that is specific for use in MapPoint North America; it is for illustration purposes only.