SelHeight

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
 
S

Stefan Hoffmann

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 <--
 
B

BrunoKP

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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top