📄 formftrp.frm
字号:
ColumnWidth = 705.26
EndProperty
BeginProperty Column08
ColumnWidth = 705.26
EndProperty
BeginProperty Column09
ColumnWidth = 585.071
EndProperty
BeginProperty Column10
ColumnWidth = 705.26
EndProperty
BeginProperty Column11
ColumnWidth = 1365.165
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adcbm1
Height = 330
Left = 2760
Top = 5160
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 582
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 = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adcbm1"
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 MSAdodcLib.Adodc Adcbm
Height = 330
Left = 4800
Top = 5160
Visible = 0 'False
Width = 1815
_ExtentX = 3201
_ExtentY = 582
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 = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adcbm"
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 MSAdodcLib.Adodc Adcftcount
Height = 330
Left = 360
Top = 5160
Visible = 0 'False
Width = 2160
_ExtentX = 3810
_ExtentY = 582
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 = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=hgrs;Data Source=SERVER"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adcftcount"
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 Crystal.CrystalReport CRt2
Left = 7080
Top = 4560
_ExtentX = 741
_ExtentY = 741
_Version = 348160
ReportFileName = "\\Exchange\华冈人事\zgftrp.rpt"
Destination = 1
PrintFileLinesPerPage= 60
End
Begin VB.Label Label1
Caption = "报表处理月份 "
Height = 255
Left = 720
TabIndex = 13
Top = 375
Width = 1095
End
Begin VB.Label Label2
Caption = "处理进度"
Height = 255
Left = 240
TabIndex = 12
Top = 4095
Width = 855
End
Begin VB.Label Label3
Caption = "部门名称"
Height = 255
Left = 2520
TabIndex = 11
Top = 375
Width = 855
End
End
Attribute VB_Name = "Formftrp"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim vmonth, vbmname, vcount
Dim vzgid, vkqlid, vctime, i, j, vzgname, vbmid
Dim vgf, vzf, vgfm, vzfm
Dim vxgf, vxzf, vzgf, vzzf, vwgf, vwzf, vygf, vyzf, vyear
Dim vdate As String
Private Sub Command1_Click()
If Textmonth.Text = "" Then
MsgBox ("没有输入月份")
Textmonth.SetFocus
Else
Adcbm1.RecordSource = "select * from tbm where bmid <>''order by bmid "
Adcbm1.Refresh
Do While Not Adcbm1.Recordset.EOF
vbmid = Adcbm1.Recordset.Fields("bmid").Value
vmonth = CInt(Textmonth.Text)
vyear = Year(Date)
vmonth = CInt(Textmonth.Text)
vdate = vyear & "-" & vmonth
adczg.RecordSource = "select * from tzg where bmid='" & vbmid & "'order by zgid"
adczg.Refresh
If Not adczg.Recordset.EOF Then
vcount = adczg.Recordset.RecordCount
PBar1.Max = vcount
PBar1.Min = 0
PBar1.Value = 0
i = 0
End If
Do While Not adczg.Recordset.EOF
vzgid = adczg.Recordset.Fields("zgid").Value
Adcftcount.RecordSource = "select * from ftcount where kmonth='" & vdate & "'and zgid='" & vzgid & "'"
Adcftcount.Refresh
vxgf = 0
vxzf = 0
vzgf = 0
vzzf = 0
vwgf = 0
vwzf = 0
vygf = 0
vyzf = 0
vzgid = Adcftcount.Recordset.Fields("zgid").Value
vzgname = Adcftcount.Recordset.Fields("zgname").Value
Do While Not Adcftcount.Recordset.EOF
vxgf = vxgf + Adcftcount.Recordset.Fields("xgf").Value
vxzf = vxzf + Adcftcount.Recordset.Fields("xzf").Value
vzgf = vzgf + Adcftcount.Recordset.Fields("zgf").Value
vzzf = vzzf + Adcftcount.Recordset.Fields("zzf").Value
vwgf = vwgf + Adcftcount.Recordset.Fields("wgf").Value
vwzf = vwzf + Adcftcount.Recordset.Fields("wzf").Value
vygf = vygf + Adcftcount.Recordset.Fields("ygf").Value
vyzf = vyzf + Adcftcount.Recordset.Fields("yzf").Value
Adcftcount.Recordset.MoveNext
Loop
Adcbm.RecordSource = "select * from tbm where bmid='" & vbmid & "'"
Adcbm.Refresh
If Not Adcbm.Recordset.EOF Then
vbmname = Adcbm.Recordset.Fields("bmname").Value
End If
Adcrp.RecordSource = "select * from ftcrp where zgid='" & vzgid & "' and kqmonth='" & vdate & "'"
Adcrp.Refresh
If Adcrp.Recordset.EOF Then
Adcrp.Recordset.AddNew
Adcrp.Recordset.Fields("zgid").Value = vzgid
Adcrp.Recordset.Fields("zgname").Value = vzgname
Adcrp.Recordset.Fields("bmname").Value = vbmname
If vxgf <> 0 Then
Adcrp.Recordset.Fields("xgf").Value = vxgf
End If
If vxzf <> 0 Then
Adcrp.Recordset.Fields("xzf").Value = vxzf
End If
If vzgf <> 0 Then
Adcrp.Recordset.Fields("zgf").Value = vzgf
End If
If vzzf <> 0 Then
Adcrp.Recordset.Fields("zzf").Value = vzzf
End If
If vwgf <> 0 Then
Adcrp.Recordset.Fields("wgf").Value = vwgf
End If
If vwzf <> 0 Then
Adcrp.Recordset.Fields("wzf").Value = vwzf
End If
If vygf <> 0 Then
Adcrp.Recordset.Fields("ygf").Value = vygf
End If
If vyzf <> 0 Then
Adcrp.Recordset.Fields("yzf").Value = vyzf
End If
Adcrp.Recordset.Fields("kqmonth").Value = vdate
Adcrp.Recordset.update
End If
adczg.Recordset.MoveNext
i = i + 1
PBar1.Value = i
Loop
Adcbm1.Recordset.MoveNext
Loop
End If
Adcrp.RecordSource = "select * from ftcrp where zgid<>'-1' order by zgid"
Adcrp.Refresh
End Sub
Private Sub Command2_Click()
If Textbmname.Text = "" Then
MsgBox ("没有输入部门")
Textbmname.SetFocus
Else
If Textmonth.Text = "" Then
MsgBox ("没有输入月份")
Textmonth.SetFocus
Else
vbmid = Textbmid.Text
Adcbm1.RecordSource = "select * from tbm where bmid ='" & vbmid & "' "
Adcbm1.Refresh
Do While Not Adcbm1.Recordset.EOF
vbmid = Adcbm1.Recordset.Fields("bmid").Value
vmonth = CInt(Textmonth.Text)
vyear = Year(Date)
vdate = vyear & "-" & vmonth
vmonth = CInt(Textmonth.Text)
vdate = vyear & "-" & vmonth
adczg.RecordSource = "select * from tzg where bmid='" & vbmid & "'order by zgid"
adczg.Refresh
If Not adczg.Recordset.EOF Then
vcount = adczg.Recordset.RecordCount
PBar1.Max = vcount
PBar1.Min = 0
PBar1.Value = 0
i = 0
End If
Do While Not adczg.Recordset.EOF
vzgid = adczg.Recordset.Fields("zgid").Value
Adcftcount.RecordSource = "select * from ftcount where kmonth='" & vdate & "'and zgid='" & vzgid & "'"
Adcftcount.Refresh
vxgf = 0
vxzf = 0
vzgf = 0
vzzf = 0
vwgf = 0
vwzf = 0
vygf = 0
vyzf = 0
vzgid = Adcftcount.Recordset.Fields("zgid").Value
vzgname = Adcftcount.Recordset.Fields("zgname").Value
Do While Not Adcftcount.Recordset.EOF
vxgf = vxgf + Adcftcount.Recordset.Fields("xgf").Value
vxzf = vxzf + Adcftcount.Recordset.Fields("xzf").Value
vzgf = vzgf + Adcftcount.Recordset.Fields("zgf").Value
vzzf = vzzf + Adcftcount.Recordset.Fields("zzf").Value
vwgf = vwgf + Adcftcount.Recordset.Fields("wgf").Value
vwzf = vwzf + Adcftcount.Recordset.Fields("wzf").Value
vygf = vygf + Adcftcount.Recordset.Fields("ygf").Value
vyzf = vyzf + Adcftcount.Recordset.Fields("yzf").Value
Adcftcount.Recordset.MoveNext
Loop
Adcbm.RecordSource = "select * from tbm where bmid='" & vbmid & "'"
Adcbm.Refresh
If Not Adcbm.Recordset.EOF Then
vbmname = Adcbm.Recordset.Fields("bmname").Value
End If
Adcrp.RecordSource = "select * from ftcrp where zgid='" & vzgid & "' and kqmonth='" & vdate & "'"
Adcrp.Refresh
If Adcrp.Recordset.EOF Then
Adcrp.Recordset.AddNew
Adcrp.Recordset.Fields("zgid").Value = vzgid
Adcrp.Recordset.Fields("zgname").Value = vzgname
Adcrp.Recordset.Fields("bmname").Value = vbmname
If vxgf <> 0 Then
Adcrp.Recordset.Fields("xgf").Value = vxgf
End If
If vxzf <> 0 Then
Adcrp.Recordset.Fields("xzf").Value = vxzf
End If
If vzgf <> 0 Then
Adcrp.Recordset.Fields("zgf").Value = vzgf
End If
If vzzf <> 0 Then
Adcrp.Recordset.Fields("zzf").Value = vzzf
End If
If vwgf <> 0 Then
Adcrp.Recordset.Fields("wgf").Value = vwgf
End If
If vwzf <> 0 Then
Adcrp.Recordset.Fields("wzf").Value = vwzf
End If
If vygf <> 0 Then
Adcrp.Recordset.Fields("ygf").Value = vygf
End If
If vyzf <> 0 Then
Adcrp.Recordset.Fields("yzf").Value = vyzf
End If
Adcrp.Recordset.Fields("kqmonth").Value = vdate
Adcrp.Recordset.update
End If
adczg.Recordset.MoveNext
i = i + 1
PBar1.Value = i
Loop
Adcbm1.Recordset.MoveNext
Loop
End If
End If
Adcrp.RecordSource = "select * from ftcrp order by zgid"
Adcrp.Refresh
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Adcrp.RecordSource = " select * from ftcrp where zgid<>'' "
Adcrp.Refresh
Do While Not Adcrp.Recordset.EOF And Not Adcrp.Recordset.BOF
Adcrp.Recordset.Delete
Adcrp.Recordset.update
Adcrp.Recordset.MoveNext
If Adcrp.Recordset.EOF Or Adcrp.Recordset.BOF Then
Exit Do
End If
Loop
End Sub
Private Sub Command5_Click()
Dialogbm3.Show
End Sub
Private Sub Command6_Click()
CRt2.Action = 0
End Sub
Private Sub Form_Load()
Adcrp.RecordSource = "select * from ftcrp where zgid<>''"
Adcrp.Refresh
End Sub
Private Sub Textbmname_Change()
Dim vbmid, vbmname As String
vbmid = Textbmname.Text
Adcbm.RecordSource = "select bmname from tbm where bmid ='" & vbmid & "'"
Adcbm.Refresh
If Not Adcbm.Recordset.EOF Then
vbmname = Adcbm.Recordset.Fields("bmname").Value
Textbmname.Text = vbmname
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -