📄 form2.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form Form2
Caption = "录固定项"
ClientHeight = 6000
ClientLeft = 60
ClientTop = 345
ClientWidth = 11805
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 6000
ScaleWidth = 11805
Begin VB.Data Data2
Caption = "Data2"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 8880
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 120
Visible = 0 'False
Width = 1455
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 495
Left = 120
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 120
Visible = 0 'False
Width = 1455
End
Begin MSAdodcLib.Adodc Adodc1
Height = 495
Left = 1800
Top = 120
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
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.Frame Frame3
Height = 1455
Left = 720
TabIndex = 15
Top = 4320
Width = 3495
Begin VB.CommandButton Command6
Caption = "Command6"
Height = 495
Left = 2160
TabIndex = 21
Top = 840
Width = 1095
End
Begin VB.CommandButton Command5
Caption = "Command5"
Height = 495
Left = 1080
TabIndex = 20
Top = 840
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "Command4"
Height = 495
Left = 120
TabIndex = 19
Top = 840
Width = 975
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 495
Left = 2160
TabIndex = 18
Top = 240
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "保存"
Enabled = 0 'False
Height = 495
Left = 1080
TabIndex = 17
Top = 240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "录入"
Height = 495
Left = 120
TabIndex = 16
Top = 240
Width = 975
End
End
Begin VB.Frame Frame2
Caption = "数据区"
Height = 4935
Left = 4440
TabIndex = 2
Top = 840
Width = 6855
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "Form2.frx":0000
Height = 4575
Left = 120
TabIndex = 22
Top = 240
Width = 6615
_ExtentX = 11668
_ExtentY = 8070
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 14
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷体_GB2312"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "职工固定项信息"
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
End
Begin VB.Frame Frame1
Caption = "录入区"
Height = 3375
Left = 720
TabIndex = 1
Top = 840
Width = 3495
Begin VB.TextBox Text6
Height = 375
Left = 1200
TabIndex = 14
Text = "Text6"
Top = 2760
Width = 2055
End
Begin VB.TextBox Text5
Height = 375
Left = 1200
TabIndex = 13
Text = "Text5"
Top = 2280
Width = 2055
End
Begin VB.TextBox Text4
Height = 375
Left = 1200
TabIndex = 12
Text = "Text4"
Top = 1800
Width = 2055
End
Begin VB.TextBox Text3
Height = 375
Left = 1200
TabIndex = 11
Text = "Text3"
Top = 1320
Width = 2055
End
Begin VB.TextBox Text2
Height = 375
Left = 1200
TabIndex = 10
Text = "Text2"
Top = 840
Width = 2055
End
Begin VB.TextBox Text1
Height = 375
Left = 1200
TabIndex = 9
Text = "Text1"
Top = 360
Width = 2055
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "粮食补贴:"
Height = 180
Left = 240
TabIndex = 8
Top = 2880
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "副食补贴:"
Height = 180
Left = 240
TabIndex = 7
Top = 2400
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "工龄工资:"
Height = 180
Left = 240
TabIndex = 6
Top = 1920
Width = 900
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "基本工资:"
Height = 180
Left = 240
TabIndex = 5
Top = 1440
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓 名:"
Height = 180
Left = 240
TabIndex = 4
Top = 960
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "编 号:"
Height = 180
Left = 240
TabIndex = 3
Top = 480
Width = 900
End
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "工资管理系统固定项录入"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 4920
TabIndex = 0
Top = 240
Width = 3630
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click() '录入的单击动作
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus
Command1.Enabled = False
Command2.Enabled = True
Command3.Enabled = True
End Sub
Private Sub Command2_Click() '保存的单击动作
Data2.Refresh
Data2.Recordset.FindFirst "编号=" + "'" + Text1.Text + "'"
If Data2.Recordset.NoMatch = False Then
MsgBox "职工编号重复,请重新编号"
Text1.Text = ""
Text1.SetFocus
Exit Sub
End If
Command1.Enabled = True
Command2.Enabled = False
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0) = Text1.Text
Adodc1.Recordset.Fields(1) = Text2.Text
Adodc1.Recordset.Fields(2) = Val(Text3.Text)
Adodc1.Recordset.Fields(3) = Val(Text4.Text)
Adodc1.Recordset.Fields(4) = Val(Text5.Text)
Adodc1.Recordset.Fields(5) = Val(Text6.Text)
For k = 6 To 15
Adodc1.Recordset.Fields(k) = 0
Next k
s = 0
For k = 2 To 12
s = s + Adodc1.Recordset.Fields(k)
Next k
Adodc1.Recordset.Fields(14) = s
Adodc1.Recordset.Fields(15) = s - Adodc1.Recordset.Fields(13)
Adodc1.Recordset.Update
Command1.SetFocus
End Sub
Private Sub Command3_Click() '取消的单击动作
Command1.Enabled = True
Command2.Enabled = False
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Command1.SetFocus
End Sub
Private Sub Form_Activate()
For i = 6 To 15
DataGrid1.Columns(i).Visible = False
Next i
Command1.SetFocus
End Sub
Private Sub Form_Load()
Me.Top = 0
Me.Left = 0
Me.Height = gzglxt.Height - gzglxt.sb1.Height - 750 - gzglxt.Toolbar1.Height
Me.Width = gzglxt.Width - 180
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + App.Path + "\gzglxt.mdb"
Adodc1.RecordSource = "gzb"
Adodc1.Refresh
Data1.DatabaseName = App.Path + "\gzglxt.mdb"
Data1.RecordSource = "bmk"
Data1.Refresh
Data2.DatabaseName = App.Path + "\gzglxt.mdb"
Data2.RecordSource = "gzb"
Data2.Refresh
End Sub
Private Sub Text1_Change()
If Len(Text1.Text) >= 4 Then
Data1.Recordset.FindFirst "bmbh=" + "'" + Mid(Text1.Text, 1, 2) + "'"
If Data1.Recordset.NoMatch = True Then
MsgBox "没有编号为" + Left(Text1.Text, 2) + "的部门,请核对后再编号"
Text1.Text = ""
Text1.SetFocus
Else
Text2.SetFocus
End If
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text2.SetFocus
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text3.SetFocus
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text4.SetFocus
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text5.SetFocus
End Sub
Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Text6.SetFocus
End Sub
Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Command2.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -