库存删除界面设计:其功能是实现仓库现存物品记录的删除。只要在删除界面中选择要删除的物品的信息,点击删除即可。
具体代码如下:
Private Sub Command1_Click()
, "")若图片无法显示请联系QQ752018766,本论文免费,转发请注明源于www.youerw.com
If answer = vbYes Then
DataGrid1.AllowDelete = True
Adodc1.Recordset.Delete
Adodc1.Recordset.Update
DataGrid1.Refresh
MsgBox "成功删除!", vbOKOnly + vbInformation, ""
DataGrid1.AllowDelete = False
Else
Exit Sub
End If
delerror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
End Sub
(4)系统管理模块设计:此模块主要实现添加用户名和修改密码两项功能。
①添加用户界面设计:进入系统后,选择菜单”系统管理”中的下拉菜单中的”添加管理员”项就可以添加用户,出现下面所示的窗体。
具体代码如下:
Private Sub Command1_Click()
Dim sql As String
Dim rs_add As New ADODB.Recordset
If Trim(Text1.Text) = "" Then
MsgBox "用户名不能为空", vbOKOnly + vbExclamation, ""
Exit Sub
Text1.SetFocus
Else
sql = "select * from 用户管理"
rs_add.Open sql, conn, adOpenKeyset, adLockPessimistic
While (rs_add.EOF = False)
If Trim(rs_add.Fields(0)) = Trim(Text1.Text) Then
MsgBox "已有这个用户", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Exit Sub
Exit Sub
Else
rs_add.AddNew
rs_add.Fields(0) = Text1.Text
rs_add.Fields(1) = Text2.Text
rs_add.Fields(2) = Text3.Text
rs_add.Update
rs_add.Close
MsgBox "添加用户成功", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End If
End If
End Sub
图1.11 添加用户界面
②更新密码界面设计:当输入完初始密码,确认密码时,可以单击“确定”以修改当前用户的密码。
具体代码如下:
Private Sub Command1_Click()
Dim rs_chang As New ADODB.Recordset
Dim sql As String
If Trim(Text1.Text) <> Trim(Text2.Text) Or Text1.Text = "" Or Text2.Text = "" Then
MsgBox "密码不一致!", vbOKOnly + vbExclamation, ""
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
Else
sql = "select * from 用户管理 where 用户名='" & userID & "'"
rs_chang.Open sql, conn, adOpenKeyset, adLockPessimistic
rs_chang.Fields(1) = Text1.Text
rs_chang.Update
rs_chang.Close
MsgBox "密码修改成功", vbOKOnly + vbExclamation, ""
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页