感谢您使用微软产品。DataGrid对象的SelBooks属性保存了选中的多行记录的books,您可以用SelBooks集合的Add方法把多行记录设为选定。如果您希望通过按下shift+鼠标左键,一次选取datagrid中的多条记录,您需要计算要选入的记录相对于当前活跃记录的位置,作为DataGrid对象的GetBook方法的参数,获得该行的BookMark,再使用DataGrid1.SelBooks的Add方法,API函数GetKeyState用于判断shift键的状态,做出相应的操作。如下例,Private Const VK_SHIFT = &H10
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As IntegerPrivate last_selPrivate Sub Form_Load()
last_sel = 0
End SubPrivate Sub DataGrid1_SelChange(Cancel As Integer)   If GetKeyState(VK_SHIFT) < 0 Then
        relative = last_sel - DataGrid1.Row
        Text1.Text = relative
        If relative < 0 Then
          For j% = relative To -1
             DataGrid1.SelBooks.Add (DataGrid1.GetBook(j%))
          Next j%
        Else
          For j% = 1 To relative
             DataGrid1.SelBooks.Add (DataGrid1.GetBook(j%))
          Next j%
        End If
    Else
        
        last_sel = DataGrid1.Row
        Text1.Text = last_sel
    End IfEnd Sub选中多条记录后,SelBooks记录了被选中记录的位置,您可以利用它来操作记录,如下例删除所选的多条记录。
  Sub DeleteRows()
    Dim varBmk As Variant
    For Each varBmk In DataGrid1.SelBooks
        Data1.Recordset.Book = varBmk
        Data1.Recordset.Delete
        Data1.Refresh
    Next
End Sub请问谁知道“Text1.Text” 这是什么意思?