📄 main_rsgl_bxgl.frm
字号:
EndProperty
EndProperty
BeginProperty Column05
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
MarqueeStyle = 4
BeginProperty Column00
ColumnWidth = 1094.74
EndProperty
BeginProperty Column01
ColumnWidth = 1440
EndProperty
BeginProperty Column02
ColumnWidth = 1319.811
EndProperty
BeginProperty Column03
ColumnWidth = 1335.118
EndProperty
BeginProperty Column04
ColumnWidth = 1335.118
EndProperty
BeginProperty Column05
ColumnWidth = 1814.74
EndProperty
EndProperty
End
Begin MSComctlLib.ImageList ImageList1
Left = 0
Top = 2550
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 32
ImageHeight = 32
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 8
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":1663
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":1F3D
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":2817
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":30F1
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":3DCB
Key = ""
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":46A5
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":4E1F
Key = ""
EndProperty
BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "main_rsgl_bxgl.frx":5AF9
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Height = 570
Left = 7155
TabIndex = 1
Top = 1395
Width = 1845
_ExtentX = 3254
_ExtentY = 1005
ButtonWidth = 1032
ButtonHeight = 1005
Style = 1
ImageList = "ImageList1"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "add"
Object.ToolTipText = "添加"
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "modify"
Object.ToolTipText = "修改"
ImageIndex = 2
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Key = "delete"
Object.ToolTipText = "删除"
ImageIndex = 3
EndProperty
EndProperty
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "部门:"
Height = 180
Left = 75
TabIndex = 5
Top = 165
Width = 690
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "员工:"
Height = 180
Left = 75
TabIndex = 4
Top = 540
Width = 690
End
End
Attribute VB_Name = "main_rsgl_bxgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Private Sub DataGrid1_DblClick()
blnAddBX = False
Load main_rsgl_bxgl_lr
main_rsgl_bxgl_lr.Show
main_rsgl_bxgl_lr.Caption = "修改福利信息"
End Sub
Private Sub Form_Activate()
If sql1 <> "" Then
Adodc1.RecordSource = sql1
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Else
MsgBox "没有找到符合条件的记录!", , "提示窗口"
End If
End If
End Sub
Private Sub Form_Load()
'添加部门信息到cboDept
cboDept.AddItem "总公司"
rs.Open "select * from 部门表 order by 部门编号", cnn, adOpenKeyset, adLockOptimistic
If rs.RecordCount > 0 Then
rs.MoveFirst
Do While rs.EOF = False
cboDept.AddItem rs.Fields("部门名称")
rs.MoveNext
Loop
End If
rs.Close
cboDept.ListIndex = 0
DTPStartDate.Value = Date
DTPEndDate.Value = Date
End Sub
Private Sub cboDept_Click()
lstEmployee.Clear
'添加部门信息到cboDept
If cboDept.Text = "总公司" Then
rs.Open "select * from 员工信息表 order by 编号", cnn, adOpenKeyset, adLockOptimistic
If rs.RecordCount > 0 Then
rs.MoveFirst
Do While rs.EOF = False
lstEmployee.AddItem rs.Fields("编号") & rs.Fields("姓名")
rs.MoveNext
Loop
End If
rs.Close
Else
rs.Open "select * from 员工信息表 where 部门='" + cboDept + "' order by 编号", cnn, adOpenKeyset, adLockOptimistic
If rs.RecordCount > 0 Then
rs.MoveFirst
Do While rs.EOF = False
lstEmployee.AddItem rs.Fields("编号") & rs.Fields("姓名")
rs.MoveNext
Loop
End If
rs.Close
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
sql1 = ""
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "add"
blnAddBX = True
Load main_rsgl_bxgl_lr
main_rsgl_bxgl_lr.Show
main_rsgl_bxgl_lr.Caption = "添加福利信息"
Case "modify"
DataGrid1_DblClick
Case "delete"
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
MsgBox "系统没有要删除的数据!", , "提示窗口"
End If
End Select
End Sub
Private Sub Command2_Click()
Dim date1 As String, date2 As String
date1 = Str(Year(DTPStartDate.Value)) & "-" & Format(Month(DTPStartDate.Value), "00")
date2 = Str(Year(DTPEndDate.Value)) & "-" & Format(Month(DTPEndDate.Value), "00")
Adodc1.RecordSource = "员工福利表 where 所属月份 between '" + date1 + "'and '" + date2 + "'"
Adodc1.Refresh
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -