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

📄 edbook.frm

📁 简单的图书管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   2415
      Left            =   720
      TabIndex        =   0
      Top             =   4320
      Width           =   7575
      Begin VB.TextBox Text5 
         Height          =   375
         Left            =   1320
         TabIndex        =   17
         Text            =   "Text5"
         Top             =   1680
         Width           =   1455
      End
      Begin VB.TextBox Text4 
         Height          =   375
         Left            =   5040
         TabIndex        =   16
         Text            =   "Text4"
         Top             =   1080
         Width           =   1935
      End
      Begin VB.TextBox Text3 
         Height          =   375
         Left            =   5040
         TabIndex        =   15
         Text            =   "Text3"
         Top             =   480
         Width           =   1935
      End
      Begin VB.TextBox Text2 
         Height          =   375
         Left            =   1320
         TabIndex        =   14
         Text            =   "Text2"
         Top             =   1080
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   1320
         TabIndex        =   13
         Text            =   "Text1"
         Top             =   480
         Width           =   2055
      End
      Begin VB.CommandButton Command2 
         Caption         =   "重置"
         Height          =   375
         Left            =   6120
         TabIndex        =   8
         Top             =   1680
         Width           =   735
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Height          =   375
         Left            =   5400
         TabIndex        =   7
         Top             =   1680
         Width           =   735
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "出版社"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   240
         Left            =   3960
         TabIndex        =   6
         Top             =   1080
         Width           =   720
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "作者"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   240
         Left            =   3960
         TabIndex        =   5
         Top             =   480
         Width           =   480
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "借否"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   240
         Left            =   240
         TabIndex        =   4
         Top             =   1680
         Width           =   480
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "书名"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   240
         Left            =   240
         TabIndex        =   3
         Top             =   1080
         Width           =   480
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "图书编号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H8000000D&
         Height          =   240
         Left            =   240
         TabIndex        =   2
         Top             =   480
         Width           =   960
      End
   End
End
Attribute VB_Name = "edbook"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
   Dim str As String
   str = ""
   If Trim(Text1.Text) <> "" Then
      If str = "" Then
         str = "图书编号='" + Trim(Text1.Text) + "'"
      Else
         str = str + "and 图书编号='" + Trim(Text1.Text) + "'"
      End If
   End If
   If Trim(Text2.Text) <> "" Then
    If str = "" Then
        str = "书名='" + Trim(Text2.Text) + "'"
    Else
        str = str + "and 书名='" + Trim(Text2.Text) + "'"
    End If
   End If
   If Trim(Text3.Text) <> "" Then
      If str = "" Then
        str = "作者='" + Trim(Text3.Text) + "'"
      Else
        str = str + "and 作者='" + Trim(Text3.Text) + "'"
      End If
   End If
   
   If Trim(Text4.Text) <> "" Then
    If str = "" Then
        str = "出版社='" + Trim(Text4.Text) + "'"
    Else
        str = str + "and 出版社='" + Trim(Text4.Text) + "'"
    End If
   End If
   
   If Trim(Text5.Text) <> "" Then
    If str = "" Then
        str = "借否='" + Trim(Text4.Text) + "'"
    Else
        str = str + "and 借否='" + Trim(Text5.Text) + "'"
    End If
   End If
   If str <> "" Then
    Adodc1.RecordSource = "select * from book where " + str
    Adodc1.Refresh
   Else
    Adodc1.RecordSource = "select * from book "
    Adodc1.Refresh
   End If
   recs = Adodc1.Recordset.RecordCount
   If recs = 0 Then
    MsgBox "没有任何符合条件的记录", vbOKOnly, "信息提示"
   End If
   Call encomm
       
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""

End Sub

Private Sub Command3_Click()
flag = 1
edbook1.Show vbModal
End Sub

Private Sub Command4_Click()
flag = 2
edbook1.Show vbModal
End Sub

Private Sub Command5_Click()
    If MsgBox("真的要删除[" + Trim(Adodc1.Recordset.Fields("书名")) + "]吗?", vbYesNo, "信息提示") = vbYes Then
        Adodc1.Recordset.Delete
        recs = recs - 1
        Call encomm
    End If
    
End Sub

Private Sub Command6_Click()
Unload Me

End Sub

Private Sub Form_Activate()
DataGrid1.SetFocus
Call encomm
End Sub

Private Sub Form_Load()
recs = Adodc1.Recordset.RecordCount
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""

End Sub

Private Sub encomm()
If recs = 0 Then
    Command4.Enabled = False
    Command5.Enabled = False
Else
    Command4.Enabled = True
    Command5.Enabled = True
    
End If

End Sub

Private Sub text_KeyPress(Index As Integer, KeyAscii As Integer)
Call endate(KeyAscii)

End Sub

⌨️ 快捷键说明

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