假设DATAGRID1控件的数据源是ADODC1控件,即: Private Sub DataGrid1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If Adodc1.Recordset.EOF = False Then DataGrid1.Row = DataGrid1.Row + 1 End If End If End Sub
Private Sub DataGrid1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Rs.AddNew End If End Sub
Private Sub DataGrid1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Adodc1.Recordset.EOF = False Then
DataGrid1.Row = DataGrid1.Row + 1
End If
End If
End Sub
If KeyAscii = 13 Then
Rs.AddNew
End If
End Sub