In the subform the code:
-
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
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
-
Is filling the fields of the mainform with the rows and more important the keys (here field1). The same loop can be used to execute an insert statement for duplicating the selected rows.
What more do you need o know ?
Nic;o)