You'll need the subform's OnCurrent event with code like:
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
Parent.txtSelLength = Me.SelHeight
Parent.txtSelstart = Me.SelTop
Dim rs As Recordset
Dim intI As Integer
Set rs = Me.RecordsetClone
rs.MoveFirst
intI = 1
While intI < Me.SelTop
intI = intI + 1
rs.MoveNext
Wend
'now positioned on the first
'Init resultfield
Parent.txtSelected = ""
intI = 0
While intI < Me.SelHeight
Parent.txtSelected = Parent.txtSelected & " " & rs!Field1
intI = intI + 1
rs.MoveNext
Wend
Set rs = Nothing
End Sub
When you place the Parent.txt... fields on your mainform and change rs!field1 into the name of your keyfield, then you'll see the effect. (Make sure you have a reference set to the DAO library)
Nic;o)
Thanks Nico, I've tried that, and it works, but I was asking about how can I update a selection of several records from a datasheet subform in the following way:
subform:.....field1.....field2
......................1..........true
......................2..........true
>
...................3..........true
>
...................4..........true
so, if the selection will is 3-4 then by using the command button from the main form, i need the subform to be changed to this:
subform:.....field1.....field2
......................1..........true
......................2..........true
......................3..........false
......................4..........false
the main reason I can't figure out how to do it, except the fact that I don't understand very well the mechanics of working with recordsets, is because as I select several records from the subform, and press the command button, the records are being dis-selected because the subform losts the focus.