📄 frm_bminfo.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frm_bminfo
Caption = "部门信息登记表"
ClientHeight = 2460
ClientLeft = 60
ClientTop = 450
ClientWidth = 5730
Icon = "Frm_bminfo.frx":0000
LinkTopic = "Form1"
ScaleHeight = 2460
ScaleWidth = 5730
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 540
Top = 2520
Width = 4575
_ExtentX = 8070
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\毕业设计\TIZIANO.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\毕业设计\TIZIANO.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from tab_部门"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text5
DataField = "职能描述"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1005
Left = 945
TabIndex = 4
Top = 1155
Width = 3480
End
Begin VB.TextBox Text4
DataField = "部门电话"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3150
TabIndex = 3
Top = 630
Width = 1275
End
Begin VB.TextBox Text3
DataField = "部门经理"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 945
TabIndex = 2
Top = 630
Width = 1275
End
Begin VB.TextBox Text2
DataField = "名称"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Left = 3150
TabIndex = 1
Top = 105
Width = 1275
End
Begin VB.TextBox Text1
DataField = "编码"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 945
TabIndex = 0
Top = 105
Width = 1275
End
Begin VB.CommandButton Command4
Caption = "取 消"
Height = 375
Left = 4620
TabIndex = 5
Top = 315
Width = 975
End
Begin VB.CommandButton Command3
Caption = "返 回"
Height = 375
Left = 4620
TabIndex = 7
Top = 1470
Width = 975
End
Begin VB.CommandButton Command2
Caption = "保 存"
Height = 375
Left = 4620
TabIndex = 6
Top = 892
Width = 975
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "职能描述:"
Height = 180
Left = 120
TabIndex = 12
Top = 1455
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "部门经理:"
Height = 180
Left = 120
TabIndex = 11
Top = 675
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "部门电话:"
Height = 180
Left = 2280
TabIndex = 10
Top = 675
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "部门名称:"
Height = 180
Left = 2280
TabIndex = 9
Top = 195
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "部门编号:"
Height = 180
Left = 120
TabIndex = 8
Top = 210
Width = 900
End
End
Attribute VB_Name = "Frm_bminfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
If Text1 = "" Or Text2 = "" Or Text3 = "" Then
MsgBox "各项基本信息不能为空"
Text1.SetFocus
Else
Adodc1.Recordset.Fields("编码") = Trim(Text1.Text)
Adodc1.Recordset.Fields("名称") = Trim(Text2.Text)
Adodc1.Recordset.Fields("部门经理") = Trim(Text3.Text)
Adodc1.Recordset.Fields("部门电话") = Trim(Text4.Text)
Adodc1.Recordset.Fields("职能描述") = Trim(Text5.Text)
Adodc1.Recordset.Update
Frm_bminfocu.Adodc1.RecordSource = "select * from tab_部门"
Frm_bminfocu.Adodc1.Refresh
MsgBox "信息保存成功"
Call clear
Unload Frm_bminfo
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Call clear
End Sub
Private Sub clear()
Frm_bminfo.Text1.Text = " "
Frm_bminfo.Text2.Text = " "
Frm_bminfo.Text3.Text = " "
Frm_bminfo.Text4.Text = " "
Frm_bminfo.Text5.Text = " "
End Sub
Private Sub Form_Unload(Cancel As Integer)
Frm_bminfocu.GurhanCoolButton1.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -