SelHeight

  • Thread starter Thread starter BrunoKP
  • Start date Start date
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
 
hi Bruno,
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?
The problem is, that when clicking a button, the selection is cleared:

http://support.microsoft.com/kb/294202


mfG
--> stefan <--
 
Hi Stefan
I have really tried to understand and copy the example you have linked to,
but I still get SeHeight=0, while the SelTop gives the correct result?

Set frm = Me.ufTimeReg.Form
Set rs = frm.RecordsetClone
rs.MoveFirst
rs.Move Me.ufTimeReg.Form.SelTop - 1
AntalSelRecs = Me.ufTimeReg.Form.SelHeight
MsgBox "Antal selecterede records: " & AntalSelRecs
regNr = rs![TimeRegID]

--
Thanks
Bruno


"Stefan Hoffmann" skrev:
 
Back
Top