⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adfrm.frm

📁 图书管理系统:分成图书管理模块和图书查询模块
💻 FRM
📖 第 1 页 / 共 5 页
字号:
      Data7.Recordset.Edit
      Data7.Recordset.Fields("有否") = "有"
      Data7.Recordset.Update
      response = MsgBox("这本书已经有预约!请予以保留!", vbInformation, "提示")
   Else
      Data4.Recordset.MoveFirst
      Data4.Recordset.FindFirst "书名" & "=" & "'" & t & "'"
      Data4.Recordset.Edit
      Data4.Recordset.Fields("现有数量") = Data4.Recordset.Fields("现有数量") + 1
      Data4.Recordset.Update
   End If
Else
   Data4.Recordset.MoveFirst
   Data4.Recordset.FindFirst "书名" & "=" & "'" & t & "'"
   Data4.Recordset.Edit
   Data4.Recordset.Fields("现有数量") = Data4.Recordset.Fields("现有数量") + 1
   Data4.Recordset.Update
End If

If myday > 0 Then
   response2 = MsgBox("您已经过期" & CStr(myday) & "天!罚款额为:" & CStr(myday * 0.2) & "元", vbExclamation, "警告")
End If

response1 = MsgBox("是否继续当前用户的还书操作?", vbYesNo, "选择")
If response1 = vbYes Then
   Command4.Enabled = False
   Exit Sub
End If
If response1 = vbNo Then
   Text4.Text = ""
   Text4.SetFocus
   Text5.Text = ""
   Command4.Enabled = False
   Data5.RecordSource = ""
   Data5.Refresh
End If
End Sub

Private Sub Command5_Click()
'查询
Dim selectsql As String
selectsql = ""

If Text6.Text <> "" Then selectsql = selectsql & " and 书名" & "=" & "'" & Text6.Text & "'"
If Text7.Text <> "" Then selectsql = selectsql & " and 作者1" & "=" & "'" & Text7.Text & "' or 作者2" & "=" & "'" & Text7.Text & "'"
If Combo1.Text <> "" Then selectsql = selectsql & " and 分类" & "=" & "'" & Combo1.Text & "'"
If Text8.Text <> "" Then selectsql = selectsql & " and 主题词" & "=" & "'" & Text8.Text & "'"
If Text9.Text <> "" Then selectsql = selectsql & " and 出版社" & "=" & "'" & Text9.Text & "'"

If selectsql <> "" Then
   Data8.Refresh
   Data8.RecordSource = "select * from 书库清单 where 书名<>''" & selectsql
   Data8.Refresh
End If

Call Command6_Click
End Sub

Private Sub Command6_Click()
'取消查询
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0

Text6.Text = ""
Text6.Enabled = False
Text6.BackColor = &H8000000F
Text7.Text = ""
Text7.Enabled = False
Text7.BackColor = &H8000000F
Text8.Text = ""
Text8.Enabled = False
Text8.BackColor = &H8000000F
Text9.Text = ""
Text9.Enabled = False
Text9.BackColor = &H8000000F

Combo1.Text = ""
Combo1.Enabled = False

End Sub

Private Sub Command7_Click()
'查询操作
Dim mystr As String
If Option1.Value = True Then
   mystr = "帐号" & "=" & "'" & Trim(Text10.Text) & "'"
   Data9.Refresh
   Data9.RecordSource = "select * from 借书单 where " & mystr
   Data9.Refresh
   Text10.Text = ""
   
End If

If Option2.Value = True Then
   mystr = "书名" & "=" & "'" & Trim(Text11.Text) & "'"
   Data9.Refresh
   Data9.RecordSource = "select * from 借书单 where " & mystr
   Data9.Refresh
   Text11.Text = ""
End If

If Option3.Value = True Then
   mystr = "还书日期" & "<=" & "#" & CStr(Date) & "#"
   Data9.Refresh
   Data9.RecordSource = "select * from 借书单 where " & mystr
   Data9.Refresh
End If

Call Option1_Click

End Sub

Private Sub Command8_Click()
'查询预约书库
Dim mystr As String

If Option4.Value = True Then
   Data10.Refresh
   Data10.RecordSource = "select * from 预订书单"
   Data10.Refresh
End If

If Option5.Value = True Then
   mystr = "有否" & "=" & "'" & "有" & "'"
   Data10.Refresh
   Data10.RecordSource = "select * from 预订书单 where " & mystr
   Data10.Refresh
End If

If Option6.Value = True Then
   mystr = "有否" & "=" & "'" & "否" & "'"
   Data10.Refresh
   Data10.RecordSource = "select * from 预订书单 where " & mystr
   Data10.Refresh
End If

End Sub

Private Sub Command9_Click()
'遗失书身份确认
Dim mystr As String
Dim response As String

mystr = "帐号" & "=" & "'" & Trim(Text12.Text) & "'"

Data13.Recordset.MoveFirst
Data13.Recordset.FindFirst mystr

If Not Data13.Recordset.NoMatch Then
   If Trim(Data13.Recordset.Fields("密码")) = Trim(Text13.Text) Then
      Data12.RecordSource = "select * from 借书单 where " & mystr
      Data12.Refresh
   Else
      response = MsgBox("对不起!您的密码输入有误,请重新输入!", vbExclamation, "警告")
      Text13.Text = ""
      Text13.SetFocus
   End If
End If


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 MSFlexGrid4_Click()
Command4.Enabled = True
End Sub

Private Sub MSFlexGrid8_Click()
If MSFlexGrid8.Rows = 1 Then
   Exit Sub
End If
Command10.Enabled = True
End Sub

Private Sub Option1_Click()
If Option1.Value = True Then
   Text10.Enabled = True
   Text10.BackColor = &HFFFFFF
   Text10.SetFocus
   Text11.Text = ""
   Text11.Enabled = False
   Text11.BackColor = &H8000000F
End If
End Sub

Private Sub Option2_Click()
If Option2.Value = True Then
   Text11.Enabled = True
   Text11.BackColor = &HFFFFFF
   Text11.SetFocus
   Text10.Text = ""
   Text10.Enabled = False
   Text10.BackColor = &H8000000F
End If

End Sub

Private Sub Option3_Click()
If Option3.Value = True Then
   Text11.Text = ""
   Text11.Enabled = False
   Text11.BackColor = &H8000000F
   Text10.Text = ""
   Text10.Enabled = False
   Text10.BackColor = &H8000000F
End If

End Sub

Private Sub TabStrip1_Click()
'操作选择

If TabStrip1.SelectedItem.Index = 1 Then
   Frame6.Visible = True
   Frame8.Visible = False
   Frame10.Visible = False
   
   Call Command6_Click
   Data8.Refresh
End If

If TabStrip1.SelectedItem.Index = 2 Then
   Frame8.Visible = True
   Frame6.Visible = False
   Frame10.Visible = False
   Text10.Height = 270
   Text10.Text = ""
   Text11.Height = 270
   Text11.Text = ""
   With MSFlexGrid6
        .ColWidth(0) = 1500
        .ColWidth(1) = 2500
        .ColWidth(2) = 2000
        .ColWidth(3) = 2000
   End With
   Data9.Refresh
End If

If TabStrip1.SelectedItem.Index = 3 Then
   Frame10.Visible = True
   Frame6.Visible = False
   Frame8.Visible = False
   With MSFlexGrid7
        .ColWidth(0) = 1500
        .ColWidth(1) = 2500
        .ColWidth(2) = 1000
   End With
   Data10.Refresh
End If

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
            Frame5.Enabled = False
            Frame5.Visible = False
            Frame11.Enabled = False
            Frame11.Visible = False
            Frame12.Enabled = False
            Frame12.Visible = False
            
            Text1.Height = 270
            Text1.Text = ""
            Text1.SetFocus
            Text2.Height = 270
            Text2.Text = ""
            Text3.Height = 270
            Text3.Text = ""
            Text16.Height = 270
            Text16.Text = ""
            Text17.Height = 270
            Text17.Text = ""
            Check6.Value = 0
            
            With MSFlexGrid1
                 .ColWidth(0) = 1500
                 .ColWidth(1) = 2500
                 .ColWidth(2) = 2000
                 .ColWidth(3) = 2000
            End With
            
            With MSFlexGrid2
                 .ColWidth(0) = 2500
                 .ColWidth(1) = 2000
                 .ColWidth(2) = 1000
                 .ColWidth(3) = 1300
                 .ColWidth(4) = 1500
                 .ColWidth(5) = 600
                 .ColWidth(6) = 2500
                 .ColWidth(7) = 600
                 .ColWidth(8) = 600
             End With
            
            Data1.Refresh
            Data2.Refresh
            Data3.Refresh
            
            StatusBar1.Panels(1).Text = "您现在正在进行《借阅书籍》操作。。"
       Case 2
            Frame1.Enabled = False
            Frame1.Visible = False
            Frame3.Enabled = True
            Frame3.Visible = True
            Frame5.Enabled = False
            Frame5.Visible = False
            Frame11.Enabled = False
            Frame11.Visible = False
            Frame12.Enabled = False
            Frame12.Visible = False
            
            Text4.Height = 270
            Text4.Text = ""
            Text4.SetFocus
            Text5.Height = 270
            Text5.Text = ""
            With MSFlexGrid4
                 .ColWidth(0) = 1500
                 .ColWidth(1) = 2500
                 .ColWidth(2) = 2000
                 .ColWidth(3) = 2000
            End With
            
            With MSFlexGrid3
                  .ColWidth(0) = 1500
                  .ColWidth(1) = 2500
                  .ColWidth(2) = 2000
                  .ColWidth(3) = 2000
            End With
     
            Data4.Refresh
            Data5.Refresh
            Data6.Refresh
            Data7.Refresh
            StatusBar1.Panels(1).Text = "您现在正在进行《归还书籍》操作。选择后进行删除。"

       Case 3
            Frame1.Enabled = False
            Frame1.Visible = False
            Frame3.Enabled = False
            Frame3.Visible = False
            Frame5.Enabled = True
            Frame5.Visible = True
            Frame11.Enabled = False
            Frame11.Visible = False
            Frame12.Enabled = False
            Frame12.Visible = False
            
            Text6.Height = 270
            Text6.Text = ""
            Text7.Height = 270
            Text7.Text = ""
            Text8.Height = 270
            Text8.Text = ""
            Text9.Height = 270
            Text9.Text = ""
            Combo1.Left = 1760
            Combo1.Top = 1550
            With MSFlexGrid5
                 .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
            
            Data8.Refresh
            StatusBar1.Panels(1).Text = "您现在正在进行《查询信息》操作。"
       Case 4
            Frame1.Enabled = False
            Frame1.Visible = False
            Frame3.Enabled = False
            Frame3.Visible = False
            Frame5.Enabled = False
            Frame5.Visible = False
            Frame11.Enabled = True

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -