B
BrunoKP
ufTimeReg is a subform with a datasheet. SelHeight = 0 when I select several
records with the mouse. RecordCount has the right number of records.
Do I have to change any property to get SelHeight containing the number of
selected records?
Dim rs As DAO.Recordset
Dim lng As Long
Dim strField As String
Dim regTotal As Long
Set rs = Me.ufTimeReg.Form.RecordsetClone
If rs.RecordCount > 0 Then
rs.MoveFirst
rs.Move Me.SelTop - 1
Do While lng < Me.ufTimeReg.Form.SelHeight And Not rs.EOF
regTotal = regTotal + Nz(rs(strField), 0)
rs.MoveNext
lng = lng + 1
Loop
End If
Set rs = Nothing
records with the mouse. RecordCount has the right number of records.
Do I have to change any property to get SelHeight containing the number of
selected records?
Dim rs As DAO.Recordset
Dim lng As Long
Dim strField As String
Dim regTotal As Long
Set rs = Me.ufTimeReg.Form.RecordsetClone
If rs.RecordCount > 0 Then
rs.MoveFirst
rs.Move Me.SelTop - 1
Do While lng < Me.ufTimeReg.Form.SelHeight And Not rs.EOF
regTotal = regTotal + Nz(rs(strField), 0)
rs.MoveNext
lng = lng + 1
Loop
End If
Set rs = Nothing