📄 safrm.frm
字号:
If Data7.Recordset.RecordCount = 0 Then
Data7.Recordset.AddNew
Data7.Recordset.Fields("帐号") = Text15.Text
Data7.Recordset.Fields("用户名") = Text16.Text
Data7.Recordset.Fields("密码") = Text17.Text
Data7.Recordset.Fields("工作单位") = Text18.Text
Data7.Recordset.Fields("联系地址") = Text19.Text
Data7.Recordset.Fields("已借本数") = 0
Data7.Recordset.Update
End If
Call Option3_Click
End Sub
Private Sub Command9_Click()
'删除用户
Dim mystr As String
Dim response As String
If Option4.Value = True Then
mystr = "用户名" & "=" & "'" & Trim(Text20.Text) & "'"
Data8.Recordset.MoveFirst
Data8.Recordset.FindFirst mystr
If Not Data8.Recordset.NoMatch Then
If Trim(Data8.Recordset.Fields("密码")) = Trim(Text21.Text) Then
Data8.Recordset.Delete
Data8.Refresh
Else
response = MsgBox("您无权删除该用户", vbExclamation, "警告")
Call Command10_Click
End If
End If
Call Command10_Click
End If
If Option5.Value = True Then
mystr = "用户名" & "=" & "'" & Trim(Text20.Text) & "'"
Data9.Recordset.MoveFirst
Data9.Recordset.FindFirst mystr
If Not Data9.Recordset.NoMatch Then
If Trim(Data9.Recordset.Fields("密码")) = Trim(Text21.Text) Then
Data9.Recordset.Delete
Data9.Refresh
Else
response = MsgBox("您无权删除该用户", vbExclamation, "警告")
Call Command10_Click
End If
End If
Call Command10_Click
End If
End Sub
Private Sub delbook_Click()
'删除操作
If Data2.Recordset.RecordCount = 0 Then
delbook.Enabled = False
Exit Sub
End If
Dim i, j As Integer
i = MSFlexGrid1.RowSel
j = MSFlexGrid1.Rows
If j = 2 Then
MSFlexGrid1.AddItem "", 1
MSFlexGrid1.RemoveItem (2)
Data2.Recordset.Delete
Else
MSFlexGrid1.RemoveItem (i)
Data2.Recordset.AbsolutePosition = i - 1
Data2.Recordset.Delete
End If
delbook.Enabled = False
End Sub
Private Sub Form_Load()
Call ResizeInit(Me) '在程序装入时必须加入
StatusBar1.Panels(1).Text = "您现在正在进行《增加书籍》操作。请将书籍资料填写完整"
End Sub
Private Sub Form_Resize()
Call ResizeForm(Me) '确保窗体改变时控件随之改变
'固定控件
Text1.Left = 1560
Text1.Height = 270
Text2.Left = 1560
Text2.Height = 270
Text3.Left = 1560
Text3.Height = 270
Text4.Left = 1560
Text4.Height = 270
Text5.Left = 1560
Text5.Height = 270
Text7.Left = 6500
Text7.Height = 270
Text8.Left = 6500
Text8.Height = 270
Text9.Left = 6500
Text9.Height = 270
Combo1.Top = 500
Combo1.Left = 6500
End Sub
Private Sub MSFlexGrid1_Click()
delbook.Enabled = True
End Sub
Private Sub Option1_Click()
'判断新用户
If Option1.Value = True Then
Text14.BackColor = &H8000000F
Text14.Enabled = False
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text12.SetFocus
Combo3.Enabled = True
End If
End Sub
Private Sub Option2_Click()
'判断老用户
If Option2.Value = True Then
Text14.BackColor = &HFFFFFF
Text14.Enabled = True
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Combo3.Enabled = False
Text12.SetFocus
End If
End Sub
Private Sub Option3_Click()
'判断新用户,产生新帐号
Dim mystr, k
Data7.Refresh
If Data7.Recordset.RecordCount = 0 Then
Text15.Text = CStr(Year(Date)) & "0000"
Else
Data7.Recordset.MoveLast
k = Data7.Recordset.RecordCount
mystr = CStr(Year(Date)) & "0000"
Text15.Text = CStr(Val(mystr) + k + 1)
End If
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
End Sub
Private Sub Option4_Click()
Data8.Refresh
End Sub
Private Sub Option5_Click()
Data9.Refresh
End Sub
Private Sub TabStrip1_Click()
'操作选择
If TabStrip1.SelectedItem.Index = 1 Then
Frame5.Visible = True
Frame7.Visible = False
Frame8.Visible = False
Call Command2_Click
End If
If TabStrip1.SelectedItem.Index = 2 Then
Frame7.Visible = True
Frame5.Visible = False
Frame8.Visible = False
Text10.Height = 270
Text10.Text = ""
With MSFlexGrid5
.ColWidth(0) = 1500
.ColWidth(1) = 1500
.ColWidth(2) = 1000
.ColWidth(3) = 1000
.ColWidth(4) = 2500
.ColWidth(5) = 2500
End With
Text10.SetFocus
End If
If TabStrip1.SelectedItem.Index = 3 Then
Frame8.Visible = True
Frame5.Visible = False
Frame7.Visible = False
Text11.Height = 270
Text11.Text = ""
Text11.SetFocus
With MSFlexGrid4
.ColWidth(0) = 2500
.ColWidth(1) = 1000
.ColWidth(2) = 1000
End With
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
'对TOOLBAR的操作
Dim i As Integer
Dim response
Select Case Button.Index
Case 1
Frame3.Enabled = False
Frame3.Visible = False
Frame1.Enabled = True
Frame1.Visible = True
Frame4.Enabled = False
Frame4.Visible = False
Frame9.Enabled = False
Frame9.Visible = False
Frame12.Enabled = False
Frame12.Visible = False
Text1.Left = 1560
Text1.Height = 270
Text2.Left = 1560
Text2.Height = 270
Text3.Left = 1560
Text3.Height = 270
Text4.Left = 1560
Text4.Height = 270
Text5.Left = 1560
Text5.Height = 270
Text7.Left = 6500
Text7.Height = 270
Text8.Left = 6500
Text8.Height = 270
Text9.Left = 6500
Text9.Height = 270
Combo1.Top = 500
Combo1.Left = 6500
With MSFlexGrid2
.ColWidth(0) = 2500
.ColWidth(1) = 1000
.ColWidth(2) = 1000
.ColWidth(3) = 1300
.ColWidth(4) = 1500
.ColWidth(5) = 600
.ColWidth(6) = 2500
.ColWidth(7) = 600
.ColWidth(8) = 600
End With
Text1.SetFocus
Call cancelbook_Click
StatusBar1.Panels(1).Text = "您现在正在进行《增加书籍》操作。请将书籍资料填写完整。"
Case 2
Frame1.Enabled = False
Frame1.Visible = False
Frame3.Enabled = True
Frame3.Visible = True
Frame4.Enabled = False
Frame4.Visible = False
Frame9.Enabled = False
Frame9.Visible = False
Frame12.Enabled = False
Frame12.Visible = False
With MSFlexGrid1
.ColWidth(0) = 2500
.ColWidth(1) = 1000
.ColWidth(2) = 1000
.ColWidth(3) = 1300
.ColWidth(4) = 1500
.ColWidth(5) = 600
.ColWidth(6) = 2500
.ColWidth(7) = 600
.ColWidth(8) = 600
End With
Data2.Refresh
StatusBar1.Panels(1).Text = "您现在正在进行《删除书籍》操作。选择后进行删除。"
Case 3
Frame1.Enabled = False
Frame1.Visible = False
Frame3.Enabled = False
Frame3.Visible = False
Frame4.Enabled = True
Frame4.Visible = True
Frame9.Enabled = False
Frame9.Visible = False
Frame12.Enabled = False
Frame12.Visible = False
For i = 0 To 3
Text6(i).Height = 270
Next i
Combo2.Left = 1790
Combo2.Top = 1350
With MSFlexGrid3
.ColWidth(0) = 2500
.ColWidth(1) = 1000
.ColWidth(2) = 1000
.ColWidth(3) = 1300
.ColWidth(4) = 1500
.ColWidth(5) = 600
.ColWidth(6) = 2500
.ColWidth(7) = 600
.ColWidth(8) = 600
.ColWidth(9) = 600
End With
StatusBar1.Panels(1).Text = "您现在正在进行《查询信息》操作。"
Case 4
Frame1.Enabled = False
Frame1.Visible = False
Frame3.Enabled = False
Frame3.Visible = False
Frame4.Enabled = False
Frame4.Visible = False
Frame9.Enabled = True
Frame9.Visible = True
Frame12.Enabled = False
Frame12.Visible = False
Text12.Height = 270
Text13.Height = 270
Text14.Height = 270
Text15.Height = 270
Text16.Height = 270
Text17.Height = 270
Text18.Height = 270
Text19.Height = 270
Combo3.Top = 3899
Combo3.Left = 1600
Call Option1_Click
Call Option3_Click
StatusBar1.Panels(1).Text = "您现在正在进行《注册用户》操作。"
Case 5
Frame1.Enabled = False
Frame1.Visible = False
Frame3.Enabled = False
Frame3.Visible = False
Frame4.Enabled = False
Frame4.Visible = False
Frame9.Enabled = False
Frame9.Visible = False
Frame12.Enabled = True
Frame12.Visible = True
Text20.Height = 270
Text21.Height = 270
StatusBar1.Panels(1).Text = "您现在正在进行《注销用户》操作。"
Call Command10_Click
Case 6
Load about
about.Show
Case 7
response = MsgBox("您是否完全退出系统?" & Chr(13) & "退出系统,请选择是。进入其他单元,请选择否。", vbYesNoCancel, "请选择")
If response = vbYes Then
Unload Me
End If
If response = vbNo Then
Unload Me
Load choose
choose.Show
End If
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -