📄 formkrp.frm
字号:
vhunja = Adckqcount.Recordset.Fields("hunja").Value
vsanja = Adckqcount.Recordset.Fields("sanja").Value
vcanja = Adckqcount.Recordset.Fields("canja").Value
vkuag = Adckqcount.Recordset.Fields("kuag").Value
vmonth = Adckqcount.Recordset.Fields("kqmonth").Value
vbmid = Adckqcount.Recordset.Fields("bmid").Value
Adcbm.RecordSource = "select * from tbm where bmid='" & vbmid & "'"
Adcbm.Refresh
If Not Adcbm.Recordset.EOF Then
vbmname = Adcbm.Recordset.Fields("bmname").Value
Else
vbmname = ""
End If
Adcrp.Recordset.AddNew
Adcrp.Recordset.Fields("zgid").Value = vzgid
Adcrp.Recordset.Fields("zgname").Value = vzgname
Adcrp.Recordset.Fields("bmname").Value = vbmname
If vpkq <> 0 Then
Adcrp.Recordset.Fields("pkq").Value = Round(vpkq, 1)
End If
If vpjb <> 0 Then
Adcrp.Recordset.Fields("pjb").Value = Round(vpjb, 1)
End If
If vxjb <> 0 Then
Adcrp.Recordset.Fields("xjb").Value = Round(vxjb, 1)
End If
If vjjb <> 0 Then
Adcrp.Recordset.Fields("jjb").Value = Round(vjjb, 1)
End If
If vrealkq <> 0 Then
Adcrp.Recordset.Fields("realkq").Value = Round(vrealkq, 1)
End If
If vklast <> 0 Then
Adcrp.Recordset.Fields("klast").Value = vklast
End If
If vkfast <> 0 Then
Adcrp.Recordset.Fields("kfast").Value = vkfast
End If
If vlastkq <> 0 Then
Adcrp.Recordset.Fields("lastkq").Value = vlastkq
End If
If vtxiu <> 0 Then
Adcrp.Recordset.Fields("txiu").Value = vtxiu
End If
If vgonsan <> 0 Then
Adcrp.Recordset.Fields("gonsan").Value = vgonsan
End If
If vbinja <> 0 Then
Adcrp.Recordset.Fields("binja").Value = vbinja
End If
If vsija <> 0 Then
Adcrp.Recordset.Fields("sija").Value = vsija
End If
If vhunja <> 0 Then
Adcrp.Recordset.Fields("hunja").Value = vhunja
End If
If vsanja <> 0 Then
Adcrp.Recordset.Fields("sanja").Value = vsanja
End If
If vcanja <> 0 Then
Adcrp.Recordset.Fields("canja").Value = vcanja
End If
If vkuag <> 0 Then
Adcrp.Recordset.Fields("kuag").Value = vkuag
End If
Adcrp.Recordset.Fields("kqmonth").Value = vmonth
Adcrp.Recordset.Update
Adckqcount.Recordset.MoveNext
i = i + 1
PBar1.Value = i
Loop
CRt2.Action = 0
Adcrp.RecordSource = " select * from kqcountrp 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
Adcbm1.Recordset.MoveNext
Loop
End If
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)
Adckqcount.RecordSource = "select * from kqcount where kqmonth='" & vmonth & "'and bmid='" & vbmid & "'"
Adckqcount.Refresh
If Not Adckqcount.Recordset.EOF Then
vcount = Adckqcount.Recordset.RecordCount
PBar1.Max = vcount
End If
PBar1.Min = 0
PBar1.Value = 0
i = 0
Do While Not Adckqcount.Recordset.EOF
vzgid = Adckqcount.Recordset.Fields("zgid").Value
vzgname = Adckqcount.Recordset.Fields("zgname").Value
vpkq = Adckqcount.Recordset.Fields("pkq").Value
vpjb = Adckqcount.Recordset.Fields("pjb").Value
vxjb = Adckqcount.Recordset.Fields("xjb").Value
vjjb = Adckqcount.Recordset.Fields("jjb").Value
vrealkq = Adckqcount.Recordset.Fields("realkq").Value
vklast = Adckqcount.Recordset.Fields("klast").Value
vkfast = Adckqcount.Recordset.Fields("kfast").Value
vlastkq = Adckqcount.Recordset.Fields("lastkq").Value
vtxiu = Adckqcount.Recordset.Fields("txiu").Value
vgonsan = Adckqcount.Recordset.Fields("gonsan").Value
vbinja = Adckqcount.Recordset.Fields("binja").Value
vsija = Adckqcount.Recordset.Fields("sija").Value
vhunja = Adckqcount.Recordset.Fields("hunja").Value
vsanja = Adckqcount.Recordset.Fields("sanja").Value
vcanja = Adckqcount.Recordset.Fields("canja").Value
vkuag = Adckqcount.Recordset.Fields("kuag").Value
vmonth = Adckqcount.Recordset.Fields("kqmonth").Value
vbmid = Adckqcount.Recordset.Fields("bmid").Value
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 kqcountrp where kqmonth='" & vmonth & "'and zgid='" & vzgid & "'"
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 vpkq <> 0 Then
Adcrp.Recordset.Fields("pkq").Value = Round(vpkq, 1)
End If
If vpjb <> 0 Then
Adcrp.Recordset.Fields("pjb").Value = Round(vpjb, 1)
End If
If vxjb <> 0 Then
Adcrp.Recordset.Fields("xjb").Value = Round(vxjb, 1)
End If
If vjjb <> 0 Then
Adcrp.Recordset.Fields("jjb").Value = Round(vjjb, 1)
End If
If vrealkq <> 0 Then
Adcrp.Recordset.Fields("realkq").Value = Round(vrealkq, 1)
End If
If vklast <> 0 Then
Adcrp.Recordset.Fields("klast").Value = vklast
End If
If vkfast <> 0 Then
Adcrp.Recordset.Fields("kfast").Value = vkfast
End If
If vlastkq <> 0 Then
Adcrp.Recordset.Fields("lastkq").Value = vlastkq
End If
If vtxiu <> 0 Then
Adcrp.Recordset.Fields("txiu").Value = vtxiu
End If
If vgonsan <> 0 Then
Adcrp.Recordset.Fields("gonsan").Value = vgonsan
End If
If vbinja <> 0 Then
Adcrp.Recordset.Fields("binja").Value = vbinja
End If
If vsija <> 0 Then
Adcrp.Recordset.Fields("sija").Value = vsija
End If
If vhunja <> 0 Then
Adcrp.Recordset.Fields("hunja").Value = vhunja
End If
If vsanja <> 0 Then
Adcrp.Recordset.Fields("sanja").Value = vsanja
End If
If vcanja <> 0 Then
Adcrp.Recordset.Fields("canja").Value = vcanja
End If
If vkuag <> 0 Then
Adcrp.Recordset.Fields("kuag").Value = vkuag
End If
Adcrp.Recordset.Fields("kqmonth").Value = vmonth
Adcrp.Recordset.Update
End If
Adckqcount.Recordset.MoveNext
i = i + 1
PBar1.Value = i
Loop
rt1.Action = 0
Adcbm1.Recordset.MoveNext
Loop
End If
End If
Adcrp.RecordSource = "select * from kqcountrp where zgid<>'-1' order by zgid"
Adcrp.Refresh
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Command4_Click()
Adcrp.RecordSource = " select * from kqcountrp 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()
Dialogbm1.Show
End Sub
Private Sub Command6_Click()
If Textbmid.Text = "" Then
MsgBox ("没有输入日期")
Textbmid.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)
Adckqcount.RecordSource = "select * from kqcount where kqmonth='" & vmonth & "'and bmid='" & vbmid & "'"
Adckqcount.Refresh
vcount = Adckqcount.Recordset.RecordCount
PBar1.Max = vcount
PBar1.Min = 0
PBar1.Value = 0
i = 0
Do While Not Adckqcount.Recordset.EOF
vzgid = Adckqcount.Recordset.Fields("zgid").Value
vzgname = Adckqcount.Recordset.Fields("zgname").Value
vpkq = Adckqcount.Recordset.Fields("pkq").Value
vpjb = Adckqcount.Recordset.Fields("pjb").Value
vxjb = Adckqcount.Recordset.Fields("xjb").Value
vjjb = Adckqcount.Recordset.Fields("jjb").Value
vrealkq = Adckqcount.Recordset.Fields("realkq").Value
vklast = Adckqcount.Recordset.Fields("klast").Value
vkfast = Adckqcount.Recordset.Fields("kfast").Value
vlastkq = Adckqcount.Recordset.Fields("lastkq").Value
vtxiu = Adckqcount.Recordset.Fields("txiu").Value
vgonsan = Adckqcount.Recordset.Fields("gonsan").Value
vbinja = Adckqcount.Recordset.Fields("binja").Value
vsija = Adckqcount.Recordset.Fields("sija").Value
vhunja = Adckqcount.Recordset.Fields("hunja").Value
vsanja = Adckqcount.Recordset.Fields("sanja").Value
vcanja = Adckqcount.Recordset.Fields("canja").Value
vkuag = Adckqcount.Recordset.Fields("kuag").Value
vmonth = Adckqcount.Recordset.Fields("kqmonth").Value
vbmid = Adckqcount.Recordset.Fields("bmid").Value
Adcbm.RecordSource = "select * from tbm where bmid='" & vbmid & "'"
Adcbm.Refresh
If Not Adcbm.Recordset.EOF Then
vbmname = Adcbm.Recordset.Fields("bmname").Value
Else
vbmname = ""
End If
Adcrp.RecordSource = "select * from kqcountrp where kqmonth='" & vmonth & "'and zgid='" & vzgid & "'"
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 vpkq <> 0 Then
Adcrp.Recordset.Fields("pkq").Value = Round(vpkq, 1)
End If
If vpjb <> 0 Then
Adcrp.Recordset.Fields("pjb").Value = Round(vpjb, 1)
End If
If vxjb <> 0 Then
Adcrp.Recordset.Fields("xjb").Value = Round(vxjb, 1)
End If
If vjjb <> 0 Then
Adcrp.Recordset.Fields("jjb").Value = Round(vjjb, 1)
End If
If vrealkq <> 0 Then
Adcrp.Recordset.Fields("realkq").Value = Round(vrealkq, 1)
End If
If vklast <> 0 Then
Adcrp.Recordset.Fields("klast").Value = vklast
End If
If vkfast <> 0 Then
Adcrp.Recordset.Fields("kfast").Value = vkfast
End If
If vlastkq <> 0 Then
Adcrp.Recordset.Fields("lastkq").Value = vlastkq
End If
If vtxiu <> 0 Then
Adcrp.Recordset.Fields("txiu").Value = vtxiu
End If
If vgonsan <> 0 Then
Adcrp.Recordset.Fields("gonsan").Value = vgonsan
End If
If vbinja <> 0 Then
Adcrp.Recordset.Fields("binja").Value = vbinja
End If
If vsija <> 0 Then
Adcrp.Recordset.Fields("sija").Value = vsija
End If
If vhunja <> 0 Then
Adcrp.Recordset.Fields("hunja").Value = vhunja
End If
If vsanja <> 0 Then
Adcrp.Recordset.Fields("sanja").Value = vsanja
End If
If vcanja <> 0 Then
Adcrp.Recordset.Fields("canja").Value = vcanja
End If
If vkuag <> 0 Then
Adcrp.Recordset.Fields("kuag").Value = vkuag
End If
Adcrp.Recordset.Fields("kqmonth").Value = vmonth
Adcrp.Recordset.Update
End If
Adckqcount.Recordset.MoveNext
i = i + 1
PBar1.Value = i
Loop
CRt2.Action = 0
Adcbm1.Recordset.MoveNext
Loop
End If
End If
Adcrp.RecordSource = "select * from kqcountrp where zgid<>'-1' order by 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 + -