📄 frm电量平衡.frm
字号:
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.Label Label15
Caption = "尖"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 0
TabIndex = 30
Top = 1650
Width = 255
End
Begin VB.Label Label14
Caption = "峰"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 29
Top = 1650
Width = 255
End
Begin VB.Label Label13
Caption = "平"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 28
Top = 1650
Width = 255
End
Begin VB.Label Label12
Caption = "谷"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5040
TabIndex = 27
Top = 1650
Width = 255
End
Begin VB.Label Label11
Caption = "总"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6720
TabIndex = 26
Top = 1650
Width = 255
End
Begin VB.Label Label10
Caption = "有功止码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 255
Left = 120
TabIndex = 20
Top = 1200
Width = 975
End
Begin VB.Label Label9
Caption = "有功起码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00008000&
Height = 255
Left = 120
TabIndex = 19
Top = 480
Width = 1215
End
Begin VB.Line Line2
BorderWidth = 2
X1 = 1320
X2 = 8520
Y1 = 1320
Y2 = 1320
End
Begin VB.Line Line1
BorderWidth = 2
X1 = 1200
X2 = 8520
Y1 = 600
Y2 = 600
End
Begin VB.Label Label7
Caption = "厂站"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 17
Top = 120
Width = 615
End
Begin VB.Label Label1
Caption = "尖"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 0
TabIndex = 16
Top = 885
Width = 255
End
Begin VB.Label Label2
Caption = "峰"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 15
Top = 885
Width = 255
End
Begin VB.Label Label3
Caption = "平"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3360
TabIndex = 14
Top = 885
Width = 255
End
Begin VB.Label Label4
Caption = "谷"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5040
TabIndex = 13
Top = 885
Width = 255
End
Begin VB.Label Label5
Caption = "总"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6720
TabIndex = 12
Top = 885
Width = 255
End
Begin VB.Label Label6
Caption = "起止码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3600
TabIndex = 11
Top = 120
Width = 1095
End
Begin VB.Label Label8
Caption = "时间"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 6120
TabIndex = 10
Top = 120
Width = 855
End
End
Attribute VB_Name = "frm电量平衡"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Combo1_Click()
Adodc1.ConnectionString = "PROVIDER=MSDASQL;dsn=ddmis;uid=mis;pwd=mis005;database=zhcx"
Adodc1.RecordSource = "select * from xdgl_dlph where rq='" & DTPicker1.Value & "' and bdz='" & Trim(Combo2.Text) & "'"
Adodc1.Refresh
Call sx
Call qk
End Sub
Private Sub Combo2_Click()
Call Open_link
sql1 = "select jld from xdgl_jld where bdz='" & Trim(Combo2.Text) & "' and dydj='" & Trim(Combo3.Text) & "'"
Combo1.Clear
Set RS = ZHCX.Execute(sql1, 0)
Do While Not RS.EOF
If Not IsNull(RS(0)) Then
Combo1.AddItem Trim(RS(0))
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
If Combo1.ListCount > 0 Then
Combo1.ListIndex = 1
End If
Call Close_link
Call qk
End Sub
Private Sub Combo3_Click()
sql1 = "select distinct BDZ from xdgl_jld where dydj='" & Trim(Combo3.Text) & "'"
Call Open_link
Combo2.Clear
Set RS = ZHCX.Execute(sql1, 0)
Do While Not RS.EOF
If Not IsNull(RS(0)) Then
Combo2.AddItem Trim(RS(0))
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
Combo1.Clear
sql1 = "select jld from xdgl_jld where dydj='" & Trim(Combo3.Text) & "' and bdz='" & Trim(Combo2.Text) & "'"
Set RS = ZHCX.Execute(sql1, 0)
Do While Not RS.EOF
If Not IsNull(RS(0)) Then
Combo1.AddItem Trim(RS(0))
End If
RS.MoveNext
Loop
If RS.State Then
RS.Close
End If
Call Close_link
End Sub
Private Sub command1_Click()
On Error Resume Next
If (Trim(Combo1.Text) = "") Or (Trim(Combo2.Text) = "") Then
A = MsgBox("请选择变电站和计量点不能为空", vbOKOnly, "错误")
Exit Sub
End If
Call Open_link
If (IsNumeric(Text1.Text)) And (IsNumeric(Text2.Text)) And (IsNumeric(Text3.Text)) And (IsNumeric(Text4.Text)) And (IsNumeric(Text5.Text)) Then
sql1 = "select * from xdgl_dlph where rq='" & DTPicker1.Value & "' and bdz='" & Trim(Combo2.Text) & "' and jld='" & Trim(Combo1.Text) & "' and dllx='起码' "
Set RS = ZHCX.Execute(sql1, 0)
If RS.EOF Then
sql1 = "insert xdgl_dlph (rq,dllx,bdz,jld,d_1,d_2,d_3,d_4,d_z,dydj) values('" & DTPicker1.Value & "','起码','" & Trim(Combo2.Text) & "','" & Trim(Combo1.Text) & "'," & Trim(Text1.Text) & "," & Trim(Text2.Text) & "," & Trim(Text3.Text) & "," & Trim(Text4.Text) & "," & Trim(Text5.Text) & ",'" & Trim(Combo3.Text) & "')"
Else
sql1 = "update xdgl_dlph set d_1=" & Text1.Text & ",d_2=" & Text2.Text & ",d_3=" & Text3.Text & ",d_4=" & Text4.Text & ",d_z=" & Text5.Text & " where rq='" & DTPicker1.Value & "' and bdz='" & Trim(Combo2.Text) & "' and jld='" & Trim(Combo1.Text) & "' and dllx='起码' and dydj='" & Trim(Combo3.Text) & "'"
End If
If RS.State Then
RS.Close
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -