??
字號:
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 = "借書天數(shù)"
Height = 255
Left = 240
TabIndex = 4
Top = 1440
Width = 735
End
Begin VB.Label Label3
Caption = "借書總數(shù)"
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 "數(shù)據(jù)項不全,請重新設(shè)置", 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 '原記錄個數(shù)大于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("借書總數(shù)") = Val(Trim(Text3.Text))
brs.Fields("借書天數(shù)") = Val(Trim(Text4.Text))
brs.Update
recs = recs + 1
Else '修改操作
brs.Fields("級別") = Trim(Text1.Text)
brs.Fields("過期罰款") = Val(Trim(Text2.Text))
brs.Fields("借書總數(shù)") = Val(Trim(Text3.Text))
brs.Fields("借書天數(shù)") = 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("借書總數(shù)")
Text4.Text = rs.Fields("借書天數(shù)")
Text1.Enabled = False
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -