📄 frm_adddep.frm
字号:
VERSION 5.00
Begin VB.Form Frm_addDep
Caption = "增加部门信息"
ClientHeight = 3165
ClientLeft = 60
ClientTop = 375
ClientWidth = 4680
LinkTopic = "Form2"
ScaleHeight = 3165
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 2520
TabIndex = 8
Top = 2520
Width = 975
End
Begin VB.CommandButton Cmd_add
Caption = "添加"
Height = 375
Left = 840
TabIndex = 7
Top = 2520
Width = 975
End
Begin VB.Frame Frame1
Height = 1935
Left = 600
TabIndex = 0
Top = 240
Width = 3495
Begin VB.TextBox txtuppid
Height = 270
Left = 1200
TabIndex = 6
Top = 1440
Width = 1695
End
Begin VB.TextBox txtDepart_Name
Height = 270
Left = 1200
TabIndex = 5
Top = 960
Width = 1695
End
Begin VB.TextBox txtDepart_Id
Height = 270
Left = 1200
TabIndex = 4
Top = 480
Width = 1695
End
Begin VB.Label Label3
Caption = "部门领导"
Height = 375
Left = 240
TabIndex = 3
Top = 1440
Width = 855
End
Begin VB.Label Label2
Caption = "部门名称"
Height = 255
Left = 240
TabIndex = 2
Top = 960
Width = 735
End
Begin VB.Label Label1
Caption = "部门编号"
Height = 255
Left = 240
TabIndex = 1
Top = 480
Width = 855
End
End
End
Attribute VB_Name = "Frm_addDep"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click()
Dim txtId As Integer
Adodcl.RecordSource = "select * from Depart Order by Depart_id desc"
Adodcl.Refresh
If Adodcl.Recordset.EOF = True Then
txtId = 1
Else
txtId = Adodcl.Recordset.Fields(0) + 1
End If
If txtDepart_Id.Text = "" Then
MsgBox ("请输入部门编号")
Exit Sub
End If
If txtDepart_Name.Text = "" Then
MsgBox ("请输入部门名称")
Exit Sub
End If
If txtuppid.Text = "" Then
MsgBox ("请输入部门领导")
Exit Sub
End If
Adodcl.Recordset.AddNew
Adodcl.Recordset.Fields(0).Value = Val(txtId)
Adodcl.Recordset.Fields(1).Value = Val(Trim(txtDepart_Id))
Adodcl.Recordset.Fields(2).Value = Trim(txtDepart_Name)
Adodcl.Recordset.Fields(3).Value = Trim(txtuppid)
Adodcl.Recordset.Update
Adodcl.Refresh
MsgBox ("部门信息增加完成")
Unload Me
End Sub
Private Sub Command2_Click()
Load FormMain
FormMain.Show
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -