Else
If Not IsNull(DataGrid1.Bookmark) Then
rs_client.Update
End If
Command2.Caption = "修改记录"
Command1.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
DataGrid1.AllowUpdate = False
MsgBox "修改成功!", vbOKOnly + vbExclamation, ""
End If
cmdmodify:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
Private Sub Command3_Click()
Dim answer As String
On Error GoTo delerror
answer = MsgBox("确定要删除吗?", vbYesNo, "")
If answer = vbYes Then
DataGrid1.AllowDelete = True
rs_client.Delete
rs_client.Update
DataGrid1.Refresh
MsgBox "成功删除!", vbOKOnly + vbExclamation, ""
DataGrid1.AllowDelete = False
Else
Exit Sub
End If
delerror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
Private Sub Command4_Click()
If Command4.Caption = "确定" Then
rs_client.Cancel
DataGrid1.ReBind
DataGrid1.AllowAddNew = False
DataGrid1.AllowUpdate = False
Command1.Caption = "新增记录"
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
ElseIf Command2.Caption = "确定" Then
rs_client.Cancel
DataGrid1.ReBind
DataGrid1.Refresh
DataGrid1.AllowUpdate = False
Command2.Caption = "修改记录"
Command1.Enabled = True
Command3.Enabled = True
Command4.Enabled = False
End If
Frame2.Enabled =