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

📄 edreader1.frm

📁 图书管理系统 内有13个窗体 (附送代码) 功能包括查询 添加删除 修改
💻 FRM
字号:
VERSION 5.00
Begin VB.Form edreader1 
   Caption         =   "编辑读者记录"
   ClientHeight    =   8070
   ClientLeft      =   60
   ClientTop       =   465
   ClientWidth     =   7440
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8070
   ScaleWidth      =   7440
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmd_cancel 
      Caption         =   "取消"
      Height          =   615
      Left            =   4080
      TabIndex        =   10
      Top             =   6960
      Width           =   1575
   End
   Begin VB.CommandButton cmd_ok 
      Caption         =   "确定"
      Height          =   615
      Left            =   1560
      TabIndex        =   9
      Top             =   6960
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      Height          =   6495
      Left            =   360
      TabIndex        =   0
      Top             =   240
      Width           =   6975
      Begin VB.TextBox txtdate 
         Height          =   495
         Left            =   1920
         MaxLength       =   10
         TabIndex        =   21
         Top             =   5760
         Width           =   2055
      End
      Begin VB.TextBox txtdaynum 
         Height          =   495
         Left            =   1920
         MaxLength       =   9
         TabIndex        =   19
         Top             =   5031
         Width           =   2055
      End
      Begin VB.TextBox txtsum 
         Height          =   495
         Left            =   1920
         MaxLength       =   9
         TabIndex        =   18
         Top             =   4308
         Width           =   2055
      End
      Begin VB.TextBox txtmulct 
         Height          =   495
         Left            =   1920
         MaxLength       =   9
         TabIndex        =   17
         Top             =   3585
         Width           =   2055
      End
      Begin VB.ComboBox cmblevel 
         Height          =   300
         ItemData        =   "edreader1.frx":0000
         Left            =   1920
         List            =   "edreader1.frx":000A
         TabIndex        =   16
         Text            =   "学生"
         Top             =   3057
         Width           =   2055
      End
      Begin VB.OptionButton Option2 
         Caption         =   "女"
         Height          =   495
         Left            =   2880
         TabIndex        =   15
         Top             =   2334
         Width           =   2055
      End
      Begin VB.OptionButton Option1 
         Caption         =   "男"
         Height          =   495
         Left            =   1920
         TabIndex        =   14
         Top             =   2334
         Width           =   2055
      End
      Begin VB.ComboBox cmbunit 
         Height          =   300
         Left            =   1920
         TabIndex        =   13
         Top             =   1806
         Width           =   2895
      End
      Begin VB.TextBox txtname 
         Height          =   495
         Left            =   1920
         MaxLength       =   16
         TabIndex        =   12
         Top             =   1083
         Width           =   2055
      End
      Begin VB.TextBox txtrno 
         Height          =   495
         Left            =   1920
         MaxLength       =   4
         TabIndex        =   11
         Top             =   360
         Width           =   2055
      End
      Begin VB.Label Label9 
         Caption         =   "登记日期"
         Height          =   375
         Left            =   600
         TabIndex        =   20
         Top             =   5880
         Width           =   1335
      End
      Begin VB.Label Label8 
         Caption         =   "借书天数"
         Height          =   375
         Left            =   600
         TabIndex        =   8
         Top             =   5205
         Width           =   1335
      End
      Begin VB.Label Label7 
         Caption         =   "借书总数"
         Height          =   375
         Left            =   600
         TabIndex        =   7
         Top             =   4530
         Width           =   1335
      End
      Begin VB.Label Label6 
         Caption         =   "过期罚款*"
         Height          =   375
         Left            =   600
         TabIndex        =   6
         Top             =   3855
         Width           =   1335
      End
      Begin VB.Label Label5 
         Caption         =   "级别"
         Height          =   375
         Left            =   600
         TabIndex        =   5
         Top             =   3180
         Width           =   1335
      End
      Begin VB.Label Label4 
         Caption         =   "性别"
         Height          =   375
         Left            =   600
         TabIndex        =   4
         Top             =   2505
         Width           =   1335
      End
      Begin VB.Label Label3 
         Caption         =   "单位"
         Height          =   375
         Left            =   600
         TabIndex        =   3
         Top             =   1830
         Width           =   1335
      End
      Begin VB.Label Label2 
         Caption         =   "姓名*"
         Height          =   375
         Left            =   600
         TabIndex        =   2
         Top             =   1155
         Width           =   1335
      End
      Begin VB.Label Label1 
         Caption         =   "借书证号*"
         Height          =   375
         Left            =   600
         TabIndex        =   1
         Top             =   480
         Width           =   1335
      End
   End
End
Attribute VB_Name = "edreader1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmblevel_LostFocus()
If Trim(cmblevel.Text) = "教师" Then
txtmulct.Text = "50"
txtsum.Text = 10
txtdaynum.Text = 60
Else
txtmulct.Text = "20"
txtsum.Text = 5
txtdaynum.Text = 30
End If
End Sub

Private Sub cmd_cancel_Click()
Unload Me
End Sub

Private Sub cmd_ok_Click()
If Trim(txtrno.Text) = "" Or Trim(txtdate.Text) = "" Or Trim(txtmulct.Text) = "" Then
MsgBox "加*号的数据不能为空,请重新设置", vbOKOnly, "信息提示"
Exit Sub
End If
If flag = 1 Then
edreader.Adodc1.Recordset.AddNew
edreader.Adodc1.Recordset.Fields("借书证号") = Trim(txtrno.Text)
edreader.Adodc1.Recordset.Fields("姓名") = Trim(txtname.Text)
If Option1.Value = True Then
edreader.Adodc1.Recordset.Fields("性别") = ""
Else
edreader.Adodc1.Recordset.Fields("性别") = ""
End If
edreader.Adodc1.Recordset.Fields("单位") = Trim(cmbunit.Text)
edreader.Adodc1.Recordset.Fields("级别") = Trim(cmblevel.Text)
edreader.Adodc1.Recordset.Fields("过期罚款") = Trim(txtmulct.Text)
edreader.Adodc1.Recordset.Fields("借书总数") = Val(Trim(txtsum.Text))
edreader.Adodc1.Recordset.Fields("借书天数") = Val(Trim(txtdaynum.Text))
edreader.Adodc1.Recordset.Fields("已借书数") = 0
edreader.Adodc1.Recordset.Fields("登记日期") = Format(Trim(txtdate.Text), "yyyy-mm-dd")
edreader.Adodc1.Recordset.Update
recs = recs + 1
Else
edreader.Adodc1.Recordset.Fields("借书证号") = Trim(txtrno.Text)
edreader.Adodc1.Recordset.Fields("姓名") = Trim(txtname.Text)
If Option1.Value = True Then
edreader.Adodc1.Recordset.Fields("性别") = "男"
Else
edreader.Adodc1.Recordset.Fields("性别") = "女"
End If
edreader.Adodc1.Recordset.Fields("单位") = Trim(cmbunit.Text)
edreader.Adodc1.Recordset.Fields("级别") = Trim(cmblevel.Text)
edreader.Adodc1.Recordset.Fields("过期罚款") = Trim(txtmulct.Text)
edreader.Adodc1.Recordset.Fields("借书总数") = Val(Trim(txtsum.Text))
edreader.Adodc1.Recordset.Fields("借书天数") = Val(Trim(txtdaynum.Text))
edreader.Adodc1.Recordset.Fields("已借书数") = 0
edreader.Adodc1.Recordset.Fields("登记日期") = Format(Trim(txtdate.Text), "yyyy-mm-dd")
edreader.Adodc1.Recordset.Update
End If
Unload Me
End Sub

Private Sub Form_Load()
If flag = 2 Then
txtrno.Text = edreader.Adodc1.Recordset.Fields("借书证号") & ""
txtname.Text = edreader.Adodc1.Recordset.Fields("姓名") & ""
If edreader.Adodc1.Recordset.Fields("性别") = "男" Then
Option1.Value = True
Else
Option2.Value = True
End If
cmbunit.Text = edreader.Adodc1.Recordset.Fields("单位") & ""
cmblevel.Text = edreader.Adodc1.Recordset.Fields("级别") & ""
txtmulct.Text = edreader.Adodc1.Recordset.Fields("过期罚款") & ""
txtsum.Text = edreader.Adodc1.Recordset.Fields("借书总数") & ""
txtdaynum.Text = edreader.Adodc1.Recordset.Fields("借书天数") & ""
txtdate.Text = edreader.Adodc1.Recordset.Fields("登记日期") & ""
txtrno.Enabled = False
Else
txtdate.Text = Date
End If
End Sub

⌨️ 快捷键说明

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