📄 frmaddreaderstyle.frm
字号:
VERSION 5.00
Begin VB.Form frmaddreaderstyle
Caption = "添加读者类别"
ClientHeight = 4590
ClientLeft = 60
ClientTop = 450
ClientWidth = 6120
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 4590
ScaleWidth = 6120
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCancle
Caption = "取消"
Height = 615
Left = 3240
TabIndex = 9
Top = 3600
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 615
Left = 960
TabIndex = 8
Top = 3600
Width = 1215
End
Begin VB.TextBox txtMaxDate
Height = 495
Left = 2160
TabIndex = 7
Top = 2520
Width = 1575
End
Begin VB.TextBox txtDate
Height = 495
Left = 2160
TabIndex = 6
Top = 1800
Width = 1575
End
Begin VB.TextBox txtBookNum
Height = 495
Left = 2160
TabIndex = 5
Top = 1080
Width = 1575
End
Begin VB.TextBox txtReaderType
Height = 495
Left = 2160
TabIndex = 4
Top = 360
Width = 1575
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "有限期限"
Height = 180
Left = 960
TabIndex = 3
Top = 2640
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "借书期限"
Height = 180
Left = 960
TabIndex = 2
Top = 1920
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "借书数量"
Height = 180
Left = 960
TabIndex = 1
Top = 1200
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "读者种类"
Height = 180
Left = 960
TabIndex = 0
Top = 600
Width = 720
End
End
Attribute VB_Name = "frmaddreaderstyle"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs_readerstyle As New ADODB.Recordset
Private Sub cmdOK_Click()
Dim sql As String
If Trim(txtReaderType.Text) = "" Then
MsgBox "读者种类不能为空", vbOKOnly + vbExclamation, ""
txtReaderType.SetFocus
Exit Sub
End If
If Trim(txtBookNum.Text) = "" Then
MsgBox "借书数量不能为空", vbOKOnly + vbExclamation, ""
txtBookNum.SetFocus
Exit Sub
End If
If Trim(txtDate.Text) = "" Then
MsgBox "借书期限不能为空", vbOKOnly + vbExclamation, ""
txtDate.SetFocus
Exit Sub
End If
If Trim(txtMaxDate.Text) = "" Then
MsgBox "有限期限不能为空", vbOKOnly + vbExclamation, ""
txtMaxDate.SetFocus
Exit Sub
End If
sql = "select * from 读者类别 where 种类名称='" & txtReaderType.Text & "'"
rs_readerstyle.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_readerstyle.EOF Then
rs_readerstyle.AddNew
rs_readerstyle.Fields(0) = Trim(txtReaderType.Text)
rs_readerstyle.Fields(1) = CInt(txtBookNum.Text)
rs_readerstyle.Fields(2) = CInt(txtDate.Text)
rs_readerstyle.Fields(3) = CInt(txtMaxDate.Text)
rs_readerstyle.Update
MsgBox "添加读者类别成功!", vbOKOnly, ""
rs_readerstyle.Close
Else
MsgBox "读者类别重复!", vbOKOnly + vbExclamation, ""
txtReaderType.SetFocus
txtReaderType.Text = ""
rs_readerstyle.Close
Exit Sub
End If
End Sub
Private Sub cmdCancle_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -