Private Sub Picture2_Click()
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
ans = MsgBox("请重新输入", 64, "同学/友情—修改")
Else
If Text2.Text = Text3.Text Then
Data1.RecordSource = "select * from load where name='" + Text1.Text + "'"
Data1.Refresh
Data1.Recordset.Edit
Data1.Recordset.Fields("passwd") = Text2.Text
Data1.Recordset.Update
MsgBox "密码修改成功!", 64, "同学/友情—修改"
Unload Me
Else
ans = MsgBox("密码不一致", 64, "同学/友情—修改")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text3.SetFocus
End If
End If
End Sub
Private Sub Picture3_Click()
Unload Me
End Sub
Private Sub Picture4_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text3.SetFocus
End Sub
5.3.3.4 资料修改功能的实现
界面图如下:
图5.3.3.4
在此功能界面中可以通过相应的按钮来实现通讯录数据的修改。通过此界面中下一条、上一条、第一条、最后一条来确定要修改的通讯录的资料,可以对资料的姓名、出生日期、邮编、QQ、电话、手机、E-mail、地址等的修改,修改完毕后点击“修改”按钮来确认所修改的信息。,下面是各个按钮的详细代码:
Private Sub Picture1_Click()
Data1.Recordset.MoveFirst
Text1.SetFocus
End Sub
Private Sub Picture2_Click()
If Data1.Recordset.BOF Then
ans = MsgBox("这已是第一条", 48, "警告")
Else
Data1.Recordset.MovePrevious
Text1.SetFocus
End If
End Sub
Private Sub Picture3_Click()
If Data1.Recordset.EOF Then
ans = MsgBox("这已是最后一条", 48, "警告")
Else
Data1.Recordset.MoveNext
Text1.SetFocus
End If
End Sub
Private Sub Picture4_Click()
Data1.Recordset.MoveLast
Text1.SetFocus
End Sub
Private Sub Picture5_Click()
Data1.Recordset.AddNew
Data1.Refresh
ans = MsgBox("个人资料修改成功", 64, "提示")
Data1.Refresh
End Sub
§5.3.3.5 用户删除功能的实现
用户删除界面图如下:
图5.3.3.5
当管理员需要删除用户时,在此界面中可以对所有的用户进行删除。
用户删除代码如下:
Private Sub Form_Load()
Data1.DatabaseName = App.Path + "\db.mdb"
End SubPrivate Sub Picture2_Click()
Data1.Recordset.MoveLast
End Sub
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>