那每條紀錄都要保存用戶名了 set datagrid1.datasource=rs Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer) if rs.bof or rs.eof then exit sub If DataGrid1.Columns("UserName").value = UserName Then DataGrid1.AllowUpdate True Else DataGrid1.AllowUpdate = True End If End Sub
set datagrid1.datasource=rs
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
if rs.bof or rs.eof then exit sub
If DataGrid1.Columns("UserName").value = UserName Then
DataGrid1.AllowUpdate True
Else
DataGrid1.AllowUpdate = True
End If
End Sub
我也是这样想的。看来只好这样了。