📄 add_reader_style1.frm
字号:
VERSION 5.00
Begin VB.Form add_reader_style1
Caption = "添加读者类别"
ClientHeight = 3945
ClientLeft = 60
ClientTop = 465
ClientWidth = 5250
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3945
ScaleWidth = 5250
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2400
TabIndex = 9
Top = 3000
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 720
TabIndex = 8
Top = 3000
Width = 1095
End
Begin VB.TextBox Text4
Height = 375
Left = 1920
TabIndex = 7
Top = 2280
Width = 2055
End
Begin VB.TextBox Text3
Height = 375
Left = 1920
TabIndex = 5
Top = 1680
Width = 2055
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 3
Top = 1080
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 1
Top = 480
Width = 2055
End
Begin VB.Label Label4
Caption = "有效期限:"
Height = 375
Left = 720
TabIndex = 6
Top = 2280
Width = 1215
End
Begin VB.Label Label3
Caption = "借书期限:"
Height = 375
Left = 720
TabIndex = 4
Top = 1680
Width = 1215
End
Begin VB.Label Label2
Caption = "借书数量:"
Height = 375
Left = 720
TabIndex = 2
Top = 1080
Width = 1095
End
Begin VB.Label Label1
Caption = "读者种类:"
Height = 375
Left = 720
TabIndex = 0
Top = 600
Width = 975
End
End
Attribute VB_Name = "add_reader_style1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public rs_reader11 As New ADODB.Recordset
Private Sub Command1_Click()
Dim sql As String
If Trim(Text1.Text) = "" Then
MsgBox "读者种类不能为空", vbOKOnly, ""
Text1.SetFocus
Text1.Text = ""
Exit Sub
End If
If Trim(Text2.Text) = "" Then
MsgBox "借书数量不能为空", vbOKOnly, ""
Text2.SetFocus
Text2.Text = ""
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "借书期限请填写", vbOKOnly, ""
Text3.SetFocus
Text3.Text = ""
Exit Sub
End If
If Trim(Text4.Text) = "" Then
MsgBox "有效期限不能为空", vbOKOnly, ""
Text4.SetFocus
Text4.Text = ""
Exit Sub
End If
sql = "select * from 读者类别 where 种类名称='" & Text1.Text & "'"
rs_reader11.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_reader11.EOF = True Then
rs_reader11.AddNew
rs_reader11.Fields(0) = Text1.Text
rs_reader11.Fields(1) = Text2.Text
rs_reader11.Fields(2) = Text3.Text
rs_reader11.Fields(3) = Text4.Text
rs_reader11.Update
rs_reader11.Close
MsgBox "添加读者类别成功", vbOKOnly, ""
Unload Me
Else
MsgBox "读者种类名称重复,请重新输入", vbOKOnly, ""
Text1.SetFocus
Text1.Text = ""
rs_reader11.Close
Exit Sub
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -