Restartable Property

Applies To

Dynamic-Type Recordset object, Dynaset-Type Recordset object, Forward-Only–Type Recordset object, Recordset object, Snapshot-Type Recordset object, Table-Type Recordset object.

Description

Returns a value that indicates whether a Recordset object supports the Requery method, which re-executes the query on which the Recordset object is based.

Return Values

The return value is a Boolean data type that is True if the Recordset object supports the Requery method. Table-type Recordset objects always return False.

Remarks

Check the Restartable property before using the Requery method on a Recordset object. If the object's Restartable property is set to False, use the OpenRecordset method on the underlying QueryDef object to re-execute the query.

See Also

OpenRecordset method, QueryDef object, Requery method.

Example

This example demonstrates the Restartable property with different Recordset objects.

Sub RestartableX()

    Dim dbsNorthwind As Database
    Dim rstTemp As Recordset

    Set dbsNorthwind = OpenDatabase("Northwind.mdb")

    With dbsNorthwind
        ' Open a table-type Recordset and print its
        ' Restartable property.
        Set rstTemp = .OpenRecordset("Employees", dbOpenTable)
        Debug.Print _
            "Table-type recordset from Employees table"
        Debug.Print "    Restartable = " & rstTemp.Restartable
        rstTemp.Close

        ' Open a Recordset from an SQL statement and print its
        ' Restartable property.
        Set rstTemp = _
            .OpenRecordset("SELECT * FROM Employees")
        Debug.Print "Recordset based on SQL statement"
        Debug.Print "    Restartable = " & rstTemp.Restartable
        rstTemp.Close

        ' Open a Recordset from a saved QueryDef object and
        ' print its Restartable property.
        Set rstTemp = .OpenRecordset("Current Product List")
        Debug.Print _
            "Recordset based on permanent QueryDef (" & _
            rstTemp.Name & ")"
        Debug.Print "    Restartable = " & rstTemp.Restartable
        rstTemp.Close

        .Close
    End With

End Sub