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

📄 frmsearchnum.frm

📁 VB编制的图书管理系统,希望可给朋友们带来帮助.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSearchNUM 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "查找书籍"
   ClientHeight    =   2400
   ClientLeft      =   180
   ClientTop       =   615
   ClientWidth     =   5010
   Icon            =   "frmSearchNUM.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2400
   ScaleWidth      =   5010
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      Height          =   135
      Left            =   240
      TabIndex        =   4
      Top             =   1440
      Width           =   4575
   End
   Begin VB.CommandButton Command2 
      Caption         =   "不想查了(&C)"
      Height          =   495
      Left            =   3240
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   1680
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "填好了(&E)"
      Height          =   495
      Left            =   1560
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1680
      Width           =   1455
   End
   Begin VB.TextBox Text1 
      ForeColor       =   &H00FF8080&
      Height          =   375
      Left            =   1560
      TabIndex        =   1
      Top             =   840
      Width           =   3015
   End
   Begin VB.Label Label4 
      BackColor       =   &H00808080&
      Caption         =   "Label4"
      Height          =   495
      Left            =   3300
      TabIndex        =   7
      Top             =   1740
      Width           =   1455
   End
   Begin VB.Label Label3 
      BackColor       =   &H00808080&
      Caption         =   "Label3"
      Height          =   495
      Left            =   1620
      TabIndex        =   6
      Top             =   1740
      Width           =   1455
   End
   Begin VB.Label Label2 
      BackColor       =   &H00808080&
      Caption         =   "Label2"
      Height          =   375
      Left            =   1620
      TabIndex        =   5
      Top             =   900
      Width           =   3015
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "请输入要查找书籍的编号"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00004080&
      Height          =   285
      Left            =   1440
      TabIndex        =   0
      Top             =   480
      Width           =   3300
   End
   Begin VB.Image Image1 
      Height          =   840
      Left            =   360
      Picture         =   "frmSearchNUM.frx":0442
      Stretch         =   -1  'True
      Top             =   360
      Width           =   840
   End
End
Attribute VB_Name = "frmSearchNUM"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Dim ADOrs1 As New Recordset
    Dim strSQL As String
    
    On Error GoTo xx
    ADOrs1.ActiveConnection = ADOcn
    
    If Label1.Caption <> "请输入要查找的借书证号" Then
    
    ADOrs1.Open "Select 书籍信息.书籍编号,书籍信息.书籍名称,书籍信息.书籍类别,书籍信息.作者,书籍信息.出版社,书籍信息.出版日期,书籍信息.登记日期,书籍信息.是否被借出,书籍信息.价格 From 书籍信息 Where 书籍信息.书籍编号='" + Text1.Text + "'"
    frmEditBook.Text1.Text = Trim(ADOrs1("书籍编号")): frmEditBook.Text2.Text = Trim(ADOrs1("书籍名称")): frmEditBook.Combo1.Text = Trim(ADOrs1("书籍类别"))
    frmEditBook.Text3.Text = Trim(ADOrs1("作者")): frmEditBook.Text4.Text = Trim(ADOrs1("出版社")): frmEditBook.Text5.Text = Trim(ADOrs1("出版日期"))
    frmEditBook.Text6.Text = Trim(ADOrs1("登记日期")): frmEditBook.Text7.Text = Trim(ADOrs1("是否被借出")): frmEditBook.Text8.Text = Trim(ADOrs1("价格"))
    ADOrs1.Close

    Else
    strSQL = "Select 读者信息.借书证号,读者信息.读者姓名,读者信息.性别,读者信息.读者类别,读者信息.工作单位,读者信息.家庭住址,读者信息.电话号码,读者信息.登记日期,读者信息.已借书数量 "
    strSQL = strSQL + " From 读者信息"
    strSQL = strSQL + " Where 读者信息.借书证号='" + Text1.Text + "'"
    ADOrs1.Open strSQL
        frmLentBookID.lvLBID.ListItems.Clear
        frmLentBookID.lvLBID.ListItems.Add , , ADOrs1.Fields("借书证号")
        With frmLentBookID.lvLBID.ListItems(1)
            .SubItems(1) = ADOrs1.Fields("读者姓名") & vbNullString
            .SubItems(2) = ADOrs1.Fields("性别") & vbNullString
            .SubItems(3) = ADOrs1.Fields("读者类别") & vbNullString
            .SubItems(4) = ADOrs1.Fields("工作单位") & vbNullString
            .SubItems(5) = ADOrs1.Fields("家庭住址") & vbNullString
            .SubItems(6) = ADOrs1.Fields("电话号码") & vbNullString
            .SubItems(7) = ADOrs1.Fields("登记日期") & vbNullString
            .SubItems(8) = ADOrs1.Fields("已借书数量") & vbNullString
        End With
        ADOrs1.Close
    End If
    Unload Me
    Exit Sub
xx:
    MsgBox "输入错误,没有该记录", vbQuestion + vbOKOnly
End Sub

Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call cmdMouseDown(Command1)
End Sub

Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Command1.BackColor = &H8000000D
End Sub

Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call cmdMouseUp(Command1)
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call cmdMouseDown(Command2)
End Sub

Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Command2.BackColor = &H8000000D
End Sub

Private Sub Command2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Call cmdMouseUp(Command2)
End Sub

Private Sub Form_Activate()
    Text1.Text = ""
    Text1.SetFocus
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Command1.BackColor = &H8000000F
    Command2.BackColor = &H8000000F
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)

    If KeyAscii = 13 Then Command1_Click
    
End Sub

⌨️ 快捷键说明

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