做一个刷新,我是多做一个按钮解决的
Private Sub Command7_Click()
On Error GoTo myerr
If MsgBox("确定要修改吗?", vbQuestion + vbYesNo, "提示") = vbYes Then
DataGrid1.AllowUpdate = True
Else
DataGrid1.AllowUpdate = False
End If
Command7.Visible = False
Command8.Visible = True
myerr:
End Sub
————————————————————
Private Sub Command8_Click()
If conn.State <> 1 Then
conn.Open connstring
End If
If MsgBox("数据库已修改!", vbInformation + vbOKOnly, "提示") = vbYes Then
DataGrid1.AllowUpdate = True
Else
DataGrid1.AllowUpdate = False
End If
Command7.Visible = True
Command8.Visible = False
End Sub