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

📄 ͼ

📁 vb模拟 图书管理系统
💻
字号:
VERSION 5.00
Begin VB.Form 图书入库1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "编辑图书记录"
   ClientHeight    =   3990
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4365
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3990
   ScaleWidth      =   4365
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      Height          =   255
      Left            =   2400
      TabIndex        =   16
      Top             =   3240
      Width           =   855
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      Height          =   255
      Left            =   840
      TabIndex        =   15
      Top             =   3240
      Width           =   855
   End
   Begin VB.Frame Frame1 
      Caption         =   "图书编号"
      Height          =   3495
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   4095
      Begin VB.CommandButton Command3 
         Caption         =   "…"
         Height          =   255
         Left            =   3720
         TabIndex        =   17
         Top             =   1800
         Width           =   255
      End
      Begin VB.TextBox Text6 
         Height          =   270
         Left            =   1080
         TabIndex        =   14
         Top             =   2520
         Width           =   975
      End
      Begin VB.TextBox Text5 
         Height          =   270
         Left            =   1080
         TabIndex        =   13
         Top             =   2160
         Width           =   735
      End
      Begin VB.TextBox Text4 
         Height          =   270
         Left            =   1080
         TabIndex        =   12
         Top             =   1440
         Width           =   1935
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1080
         TabIndex        =   11
         Top             =   1800
         Width           =   2655
      End
      Begin VB.TextBox Text3 
         Height          =   270
         Left            =   1080
         TabIndex        =   10
         Top             =   1080
         Width           =   2775
      End
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   1080
         TabIndex        =   9
         Top             =   720
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   1080
         TabIndex        =   8
         Top             =   360
         Width           =   1095
      End
      Begin VB.Label Label7 
         Caption         =   "入库日期*"
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   2520
         Width           =   855
      End
      Begin VB.Label Label6 
         Caption         =   "定    价"
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   2160
         Width           =   855
      End
      Begin VB.Label Label5 
         Caption         =   "出 版 社"
         Height          =   255
         Left            =   240
         TabIndex        =   5
         Top             =   1800
         Width           =   855
      End
      Begin VB.Label Label4 
         Caption         =   "作    者*"
         Height          =   255
         Left            =   240
         TabIndex        =   4
         Top             =   1440
         Width           =   855
      End
      Begin VB.Label Label3 
         Caption         =   "书    名*"
         Height          =   255
         Left            =   240
         TabIndex        =   3
         Top             =   1080
         Width           =   855
      End
      Begin VB.Label Label2 
         Caption         =   "分 类 号*"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   720
         Width           =   855
      End
      Begin VB.Label Label1 
         Caption         =   "图书编号*"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   360
         Width           =   855
      End
   End
End
Attribute VB_Name = "图书入库1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
 '确定
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Or Trim(Text3.Text) = "" _
Or Trim(Text4.Text) = "" Or Trim(Text6.Text) = "" Or Trim(Combo1.Text) = "" Then
MsgBox "加*数据不能为空,请重新设置", vbOKOnly, "信息提示"
Exit Sub
End If
sqltxt = "select * from book where 图书编号='" + _
Trim(Text1.Text) + "'" '对book中记录进行判断
Set rs = exesql(sqltxt)
If flag = 1 Then '添加操作,先判断是否存在相同图书编号的图书
If rs.RecordCount <> 0 Then
MsgBox "存在相同的图书编号", vbOKOnly, "信息提示"
Text1.SetFocus
rs.Close
Exit Sub
End If
rs.AddNew
rs.Fields("图书编号") = Trim(Text1.Text)
rs.Fields("分类号") = Trim(Text2.Text)
rs.Fields("出版社") = Trim(Combo1.Text)
rs.Fields("书名") = Trim(Text3.Text)
rs.Fields("作者") = Trim(Trim(Text4.Text))
rs.Fields("定价") = Val(Trim(Text5.Text))
rs.Fields("入库日期") = Format(Trim(Text6.Text), "yyyy-mm-dd")
rs.Fields("借否") = "否"
rs.Update
recs = recs + 1
Else '修改操作,判断是否存在相同借书证号的读者
rs.Fields("图书编号") = Trim(Text1.Text)
rs.Fields("分类号") = Trim(Text2.Text)
rs.Fields("出版社") = Trim(Combo1.Text)
rs.Fields("书名") = Trim(Text3.Text)
rs.Fields("作者") = Trim(Trim(Text4.Text))
rs.Fields("定价") = Val(Trim(Text5.Text))
rs.Fields("入库日期") = Format(Trim(Text6.Text), "yyyy-mm-dd")
rs.Update
End If
Unload Me
End Sub

Private Sub Command2_Click()
Unload Me
xbnum = ""
End Sub

Private Sub Command3_Click()
tna = "press"
cap = "出版社"
编辑信息.Show vbModal
End Sub

Private Sub Form_Load()
Dim sqltxt As String
Dim sqltxt1 As String
Dim i As Integer
sqltxt = "select * from press "
Set rs = exesql(sqltxt)
'Combo1.Text = rs.Fields("fn")
For i = 1 To rs.RecordCount
Combo1.AddItem rs.Fields("fn")
rs.MoveNext
Next i
If flag = 2 Then '修改操作
Text1.Text = xbnum
sqltxt1 = "select * from book where 图书编号='" + xbnum + "'"
Set brs = exesql(sqltxt1)
Text2.Text = brs.Fields("分类号")
Text3.Text = brs.Fields("书名")
Text4.Text = brs.Fields("作者")
Text5.Text = brs.Fields("定价")
Text6.Text = brs.Fields("入库日期")
Combo1.Text = brs.Fields("出版社")
Text1.Enabled = False
Else
Text6.Text = Date '添加操作
End If
End Sub

Private Sub combo1_keypress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub

Private Sub Form_Unload(Cancel As Integer)
xbnum = ""
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
Call endata(KeyAscii)
End Sub

⌨️ 快捷键说明

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