I have a continuous form (not a subform) with a table as the record source. The record selector buttons are turned on. And even though the Access Help file says "The SelHeight property. A Long Integer value between 0 and the number of records in the datasheet or continuous form.", the following code fails.
In debug I have verified that the reason it fails is because the SelHeight property is zero in spite of the fact that numerous records are selected. The SelTop property is indeed set to the first record selected as you would expect.
Any suggestions as to why the SelHeight property is zero?
==============================
Private Sub SelectButton_Click()
Dim rst As Recordset, i As Integer
If Me.SelTop > 0 Then
Set rst = Me.RecordsetClone
rst.MoveFirst
rst.Move Me.SelTop
i = 0
Do While i < Me.SelHeight
rst.Edit
rst!X = Not rst!X
rst.Update
rst.MoveNext
i = i + 1
Loop
rst.Close
End If
End Sub
==============================
Thanks,
Dan
In debug I have verified that the reason it fails is because the SelHeight property is zero in spite of the fact that numerous records are selected. The SelTop property is indeed set to the first record selected as you would expect.
Any suggestions as to why the SelHeight property is zero?
==============================
Private Sub SelectButton_Click()
Dim rst As Recordset, i As Integer
If Me.SelTop > 0 Then
Set rst = Me.RecordsetClone
rst.MoveFirst
rst.Move Me.SelTop
i = 0
Do While i < Me.SelHeight
rst.Edit
rst!X = Not rst!X
rst.Update
rst.MoveNext
i = i + 1
Loop
rst.Close
End If
End Sub
==============================
Thanks,
Dan