📄 rdfrm.frm
字号:
Private Sub Command5_Click()
'预订书籍操作
Dim response As String
Dim response1 As String
Dim i, j As Integer
i = MSFlexGrid4.RowSel
j = MSFlexGrid4.Rows
If Data3.Recordset.Fields("现有数量") <> 0 Then
response1 = MsgBox("这本书书库中还有存货,请自行寻找!", vbInformation, "提示")
Exit Sub
End If
If j = 2 Then
Data2.Recordset.AddNew
Data2.Recordset.Fields("帐号") = Text1.Text
Data2.Recordset.Fields("书名") = Data3.Recordset.Fields("书名")
Data2.Recordset.Fields("有否") = "否"
Data2.Recordset.Update
Else
Data3.Recordset.AbsolutePosition = i - 1
Data2.Recordset.AddNew
Data2.Recordset.Fields("帐号") = Text1.Text
Data2.Recordset.Fields("书名") = Data3.Recordset.Fields("书名")
Data2.Recordset.Fields("有否") = "否"
Data2.Recordset.Update
End If
response = MsgBox("您是否要继续预约书籍?", vbYesNo, "提示")
If response = vbYes Then
Text3.Text = ""
Text3.SetFocus
Command5.Enabled = False
End If
If response = vbNo Then
Text1.Text = ""
Text1.SetFocus
Text2.Text = ""
Text3.Text = ""
Command2.Enabled = False
Command5.Enabled = False
End If
End Sub
Private Sub Command6_Click()
'查询
Dim selectsql As String
selectsql = ""
If Text4.Text <> "" Then selectsql = selectsql & " and 书名" & "=" & "'" & Text4.Text & "'"
If Text5.Text <> "" Then selectsql = selectsql & " and 作者1" & "=" & "'" & Text5.Text & "' or 作者2" & "=" & "'" & Text5.Text & "'"
If Combo1.Text <> "" Then selectsql = selectsql & " and 分类" & "=" & "'" & Combo1.Text & "'"
If Text6.Text <> "" Then selectsql = selectsql & " and 主题词 " & "=" & "'" & Text6.Text & "'"
If Text7.Text <> "" Then selectsql = selectsql & " and 出版社" & "=" & "'" & Text7.Text & "'"
If selectsql <> "" Then
Data4.Refresh
Data4.RecordSource = "select * from 书库清单 where 书名<>''" & selectsql
Data4.Refresh
End If
Call Command7_Click
End Sub
Private Sub Command7_Click()
'取消查询
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Text4.Text = ""
Text4.Enabled = False
Text4.BackColor = &H8000000F
Text5.Text = ""
Text5.Enabled = False
Text5.BackColor = &H8000000F
Text6.Text = ""
Text6.Enabled = False
Text6.BackColor = &H8000000F
Text7.Text = ""
Text7.Enabled = False
Text7.BackColor = &H8000000F
Combo1.Text = ""
Combo1.Enabled = False
End Sub
Private Sub Command8_Click()
'借书检索
Dim mystr As String
Dim response As String
Dim response1 As String
mystr = "帐号" & "=" & "'" & Trim(Text8.Text) & "'"
If Data6.Recordset.RecordCount = 0 Then
response1 = MsgBox("库中没有读者信息!", vbInformation, "提示")
Exit Sub
End If
Data6.Recordset.MoveFirst
Data6.Recordset.FindFirst mystr
If Not Data6.Recordset.NoMatch Then
If Trim(Data6.Recordset.Fields("密码")) = Trim(Text9.Text) Then
Data5.Refresh
Data5.RecordSource = "select * from 借书单 where " & mystr
Data5.Refresh
Else
response = MsgBox("对不起!您的密码输入有误,请重新输入!", vbExclamation, "警告")
Text9.Text = ""
Text9.SetFocus
End If
End If
Text8.Text = ""
Text9.Text = ""
Text8.SetFocus
End Sub
Private Sub Command9_Click()
'预约检索
Dim mystr As String
Dim response As String
Dim response1 As String
mystr = "帐号" & "=" & "'" & Trim(Text10.Text) & "'"
If Data7.Recordset.RecordCount = 0 Then
response1 = MsgBox("库中没有读者信息!", vbInformation, "提示")
Exit Sub
End If
Data7.Recordset.MoveFirst
Data7.Recordset.FindFirst mystr
If Not Data7.Recordset.NoMatch Then
If Trim(Data7.Recordset.Fields("密码")) = Trim(Text11.Text) Then
Data8.Refresh
Data8.RecordSource = "select * from 预订书单 where " & mystr
Data8.Refresh
Else
response = MsgBox("对不起!您的密码输入有误,请重新输入!", vbExclamation, "警告")
Text11.Text = ""
Text11.SetFocus
End If
End If
Text10.Text = ""
Text11.Text = ""
Text10.SetFocus
End Sub
Private Sub Form_Load()
Call ResizeInit(Me) '在程序装入时必须加入
StatusBar1.Panels(1).Text = "您现在正在进行《预约书籍》操作。"
End Sub
Private Sub Form_Resize()
Call ResizeForm(Me) '确保窗体改变时控件随之改变
End Sub
Private Sub List1_Click()
Dim mystr As String
Dim response As String
If Data9.Recordset.RecordCount > 0 Then
Data9.Recordset.MoveFirst
mystr = "书名" & "=" & "'" & List1.List(List1.ListIndex) & "'"
Data9.Recordset.FindFirst mystr
Text12.Text = Data9.Recordset.Fields("简介")
End If
End Sub
Private Sub MSFlexGrid4_Click()
Command5.Enabled = True
End Sub
Private Sub TabStrip1_Click()
'操作选择
If TabStrip1.SelectedItem.Index = 1 Then
Frame4.Visible = True
Frame6.Visible = False
Frame7.Visible = False
Frame8.Visible = False
Call Command7_Click
Data4.Refresh
End If
If TabStrip1.SelectedItem.Index = 2 Then
Frame6.Visible = True
Frame4.Visible = False
Frame7.Visible = False
Frame8.Visible = False
Text8.Height = 270
Text8.Text = ""
Text9.Height = 270
Text9.Text = ""
With MSFlexGrid2
.ColWidth(0) = 1500
.ColWidth(1) = 2500
.ColWidth(2) = 2000
.ColWidth(3) = 2000
End With
Data5.Refresh
Data6.Refresh
End If
If TabStrip1.SelectedItem.Index = 3 Then
Frame7.Visible = True
Frame4.Visible = False
Frame6.Visible = False
Frame8.Visible = False
Text10.Height = 270
Text10.Text = ""
Text11.Height = 270
Text11.Text = ""
With MSFlexGrid3
.ColWidth(0) = 1500
.ColWidth(1) = 2500
.ColWidth(2) = 1000
End With
Data7.Refresh
Data8.Refresh
End If
If TabStrip1.SelectedItem.Index = 4 Then
Frame8.Visible = True
Frame4.Visible = False
Frame6.Visible = False
Frame7.Visible = False
List1.Clear
Text12.Text = ""
Data9.Refresh
End If
End Sub
Private Sub Text16_GotFocus()
Text16.SelStart = 0
Text16.SelLength = Len(Text16.Text)
End Sub
Private Sub Text17_GotFocus()
Text17.SelStart = 0
Text17.SelLength = Len(Text17.Text)
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim response As String
Select Case Button.Index
Case 1
Frame3.Enabled = False
Frame3.Visible = False
Frame1.Enabled = True
Frame1.Visible = True
Frame9.Enabled = False
Frame9.Visible = False
With MSFlexGrid4
.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
Text1.Height = 270
Text1.Text = ""
Text1.SetFocus
Text2.Height = 270
Text2.Text = ""
Text3.Height = 270
Text3.Text = ""
Data1.Refresh
Data2.Refresh
Data3.Refresh
StatusBar1.Panels(1).Text = "您现在正在进行《预约书籍》操作。"
Case 2
Frame1.Enabled = False
Frame1.Visible = False
Frame3.Enabled = True
Frame3.Visible = True
Frame9.Enabled = False
Frame9.Visible = False
Text4.Height = 270
Text5.Height = 270
Text6.Height = 270
Text7.Height = 270
Combo1.Left = 1950
Combo1.Top = 1650
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
.ColWidth(9) = 600
End With
Data4.Refresh
StatusBar1.Panels(1).Text = "您现在正在进行《查询信息》操作。选择后进行删除。"
Case 3
Frame1.Enabled = False
Frame1.Visible = False
Frame3.Enabled = False
Frame3.Visible = False
Frame9.Enabled = True
Frame9.Visible = True
Text13.Height = 270
Text13.Text = ""
Text14.Height = 270
Text14.Text = ""
Text15.Height = 270
Text15.Text = ""
Text16.Height = 270
Text16.Text = ""
Text17.Height = 270
Text17.Text = ""
Text18.Height = 270
Text18.Text = ""
Label18.Height = 255
Label18.Caption = ""
Data10.Refresh
StatusBar1.Panels(1).Text = "您现在正在进行《修改用户个人信息》操作。"
Case 4
Load about
about.Show
Case 5
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 + -