📄 frm_art_foun_kind_edit.frm
字号:
VERSION 5.00
Begin VB.Form Frm_Art_Foun_Kind_Edit
BorderStyle = 1 'Fixed Single
Caption = "节目源种类"
ClientHeight = 1830
ClientLeft = 8055
ClientTop = 6945
ClientWidth = 7020
ControlBox = 0 'False
Icon = "Frm_Art_Foun_Kind_Edit.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1830
ScaleWidth = 7020
Begin VB.CommandButton cmd_Exit
Caption = "退出(&X)"
Height = 375
Left = 5880
TabIndex = 5
Top = 1320
Width = 975
End
Begin VB.CommandButton cmd_Save
Caption = "保存(&S)"
Height = 375
Left = 4920
TabIndex = 4
Top = 1320
Width = 975
End
Begin VB.CommandButton cmd_Add
Caption = "添加(&A)"
Height = 375
Left = 3960
TabIndex = 10
Top = 1320
Width = 975
End
Begin VB.CommandButton cmd_Last
Caption = "末一条 >>"
Height = 375
Left = 3000
TabIndex = 9
Top = 1320
Width = 975
End
Begin VB.CommandButton cmd_Next
Caption = "后一条 >"
Height = 375
Left = 2040
TabIndex = 8
Top = 1320
Width = 975
End
Begin VB.CommandButton cmd_Preview
Caption = "< 前一条"
Height = 375
Left = 1080
TabIndex = 7
Top = 1320
Width = 975
End
Begin VB.CommandButton cmd_First
Caption = "<< 第一条"
Height = 375
Left = 120
TabIndex = 6
Top = 1320
Width = 975
End
Begin VB.TextBox txt_Filed_Packtype
Height = 300
Left = 1140
TabIndex = 3
Text = "Text2"
Top = 600
Width = 5655
End
Begin VB.TextBox txt_Filed_ID
Height = 300
Left = 1140
TabIndex = 2
Text = "Text1"
Top = 240
Width = 5655
End
Begin VB.Line Line1
X1 = 120
X2 = 6840
Y1 = 1080
Y2 = 1080
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "节目源种类"
Height = 180
Left = 180
TabIndex = 1
Top = 660
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "编号"
Height = 180
Left = 720
TabIndex = 0
Top = 300
Width = 360
End
End
Attribute VB_Name = "Frm_Art_Foun_Kind_Edit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim flag_Add As Boolean
Private Sub cmd_Add_Click()
On Error GoTo err
Me.txt_Filed_ID.text = ""
Me.txt_Filed_Packtype.text = ""
flag_Add = True
Me.Cmd_Add.Enabled = False
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub cmd_Exit_Click()
Unload Me
End Sub
Private Sub cmd_First_Click()
On Error GoTo err
If Rs_Common.BOF = False Then Rs_Common.MoveFirst
If IsNull(Rs_Common!编号) = False Then Me.txt_Filed_ID.text = Rs_Common!编号
If IsNull(Rs_Common!节目源种类) = False Then Me.txt_Filed_Packtype.text = Rs_Common!节目源种类
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub cmd_Last_Click()
On Error GoTo err
If Rs_Common.EOF = False Then Rs_Common.MoveLast
If IsNull(Rs_Common!编号) = False Then Me.txt_Filed_ID.text = Rs_Common!编号
If IsNull(Rs_Common!节目源种类) = False Then Me.txt_Filed_Packtype.text = Rs_Common!节目源种类
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub cmd_Next_Click()
On Error GoTo err
Rs_Common.MoveNext
If Rs_Common.EOF = True Then Rs_Common.MoveLast
If IsNull(Rs_Common!编号) = False Then Me.txt_Filed_ID.text = Rs_Common!编号
If IsNull(Rs_Common!节目源种类) = False Then Me.txt_Filed_Packtype.text = Rs_Common!节目源种类
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub cmd_Preview_Click()
On Error GoTo err
Rs_Common.MovePrevious
If Rs_Common.BOF = True Then Rs_Common.MoveFirst
If IsNull(Rs_Common!编号) = False Then Me.txt_Filed_ID.text = Rs_Common!编号
If IsNull(Rs_Common!节目源种类) = False Then Me.txt_Filed_Packtype.text = Rs_Common!节目源种类
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub cmd_Save_Click()
On Error GoTo err
If Trim(Me.txt_Filed_ID.text) = "" Or Trim(Me.txt_Filed_Packtype.text) = "" Then
MsgBox "编号和节目源种类不能为空,请输入", vbCritical
Exit Sub
End If
If flag_Add = True Then
Rs_Common.AddNew
If IsNull(Trim(Me.txt_Filed_ID.text)) = False Then Rs_Common!编号 = Val(Me.txt_Filed_ID.text)
If IsNull(Trim(Me.txt_Filed_Packtype.text)) = False Then Rs_Common!节目源种类 = Me.txt_Filed_Packtype.text
Rs_Common.Update
flag_Add = False
Me.Cmd_Add.Enabled = True
Else
If IsNull(Me.txt_Filed_ID.text) = False Then Rs_Common!编号 = Val(Me.txt_Filed_ID.text)
If IsNull(Me.txt_Filed_Packtype.text) = False Then Rs_Common!节目源种类 = Me.txt_Filed_Packtype.text
Rs_Common.Update
End If
Set Frm_Art_Foun_Kind.dgrid_Art_Kind.DataSource = Nothing
Rs_Common.Close
Rs_Common.Open "select * from Art_Fountain_Kind order by 编号", Cn_Common, adOpenKeyset, adLockOptimistic, adCmdText
Set Frm_Art_Foun_Kind.dgrid_Art_Kind.DataSource = Rs_Common
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
Private Sub Form_Load()
On Error GoTo err
If Rs_Common.RecordCount = 0 Then
flag_Add = True
Me.txt_Filed_ID.text = ""
Me.txt_Filed_Packtype.text = ""
Me.Cmd_Add.Enabled = False
Else
If IsNull(Rs_Common!编号) = False Then Me.txt_Filed_ID.text = Rs_Common!编号 Else Me.txt_Filed_ID.text = ""
If IsNull(Rs_Common!节目源种类) = False Then Me.txt_Filed_Packtype.text = Rs_Common!节目源种类 Else Me.txt_Filed_Packtype.text = ""
End If
Exit Sub
err:
MsgBox err.Description, vbCritical
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -