📄
字号:
VERSION 5.00
Begin VB.Form 添加级别1
BorderStyle = 1 'Fixed Single
Caption = "编辑记录"
ClientHeight = 2910
ClientLeft = 45
ClientTop = 435
ClientWidth = 3075
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2910
ScaleWidth = 3075
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
Height = 255
Left = 1680
TabIndex = 10
Top = 2400
Width = 855
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 255
Left = 480
TabIndex = 9
Top = 2400
Width = 855
End
Begin VB.Frame Frame1
Caption = "记录编辑"
Height = 1935
Left = 240
TabIndex = 0
Top = 240
Width = 2535
Begin VB.TextBox Text4
Height = 270
Left = 1080
TabIndex = 8
Top = 1440
Width = 1095
End
Begin VB.TextBox Text3
Height = 270
Left = 1080
TabIndex = 7
Top = 1080
Width = 1095
End
Begin VB.TextBox Text2
Height = 270
Left = 1080
TabIndex = 6
Top = 720
Width = 1095
End
Begin VB.TextBox Text1
Height = 270
Left = 1080
TabIndex = 5
Top = 360
Width = 1095
End
Begin VB.Label Label4
Caption = "借书天数"
Height = 255
Left = 240
TabIndex = 4
Top = 1440
Width = 735
End
Begin VB.Label Label3
Caption = "借书总数"
Height = 255
Left = 240
TabIndex = 3
Top = 1080
Width = 735
End
Begin VB.Label Label2
Caption = "过期罚款"
Height = 255
Left = 240
TabIndex = 2
Top = 720
Width = 735
End
Begin VB.Label Label1
Caption = "级 别"
Height = 255
Left = 240
TabIndex = 1
Top = 360
Width = 735
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() '确定
Dim sqltxt1 As String
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Or Trim(Text3.Text) = "" Or Trim(Text4.Text) = "" Then
MsgBox "数据项不全,请重新设置", vbOKOnly, "信息提示"
Text1.SetFocus
Exit Sub
End If
sqltxt1 = "select * from rlevel where 级别='" + _
Trim(Text1.Text) + "'"
Set brs = exesql(sqltxt1)
If flag = 1 Then '添加操作
If brs.RecordCount <> 0 Then '原记录个数大于0
MsgBox "存在相同的记录", vbOKOnly, "信息提示"
Text1.SetFocus
brs.Close
Exit Sub
End If
brs.AddNew
brs.Fields("级别") = Trim(Text1.Text)
brs.Fields("过期罚款") = Val(Trim(Text2.Text))
brs.Fields("借书总数") = Val(Trim(Text3.Text))
brs.Fields("借书天数") = Val(Trim(Text4.Text))
brs.Update
recs = recs + 1
Else '修改操作
brs.Fields("级别") = Trim(Text1.Text)
brs.Fields("过期罚款") = Val(Trim(Text2.Text))
brs.Fields("借书总数") = Val(Trim(Text3.Text))
brs.Fields("借书天数") = Val(Trim(Text4.Text))
brs.Update
End If
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim sqltxt As String
sqltxt = "select * from rlevel where 级别='" + userlevel1 + "'"
Set rs = exesql(sqltxt)
If flag = 2 Then
Text1.Text = rs.Fields("级别")
Text2.Text = rs.Fields("过期罚款")
Text3.Text = rs.Fields("借书总数")
Text4.Text = rs.Fields("借书天数")
Text1.Enabled = False
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -