⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm转201票查询.frm

📁 县级电力调度管理信息系统。VB6.0开发。 DMIS调度子系统包括以下功能模块:调度操作票管理、调度运行日志、调度交接班管理、调度值班管理、调度报表管理、调度文档、避峰拉闸限电管理等7个业务模块。
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   Call cx
End If

End Sub


Private Sub Command1_Click()
On Error Resume Next
Dim ph As String
If Adodc1.Recordset.EOF Then
  
Else
  If Option2.Value Then
      ph = Trim(DataGrid1.Columns(4).Value)
        Unload frm转地调逐项操作票
        frm转地调逐项操作票.Show
        frm转地调逐项操作票.Move 0, 0, 11890, 7465
        Sql = "select * from xdgl_zzxczpzb where zxlph='" & ph & "'"
        If RS.State Then
           RS.Close
        End If
        Call Open_link
        Set RS = ZHCX.Execute(Sql, 0)
        If Not RS.EOF Then
           frm转地调逐项操作票.Combo1.Text = Trim(RS("npyj"))
           frm转地调逐项操作票.Text1.Text = Trim(RS("jkbh"))
           frm转地调逐项操作票.Text3.Text = Trim(RS("czrw"))
           frm转地调逐项操作票.Text2.Text = Trim(RS("bz"))
           frm转地调逐项操作票.DTPicker2.Value = Trim(RS("zxsj"))
           If IsNull(RS("zxqk")) Then
                frm转地调逐项操作票.DataGrid1.AllowAddNew = False
                frm转地调逐项操作票.DataGrid1.AllowDelete = False
                frm转地调逐项操作票.DataGrid1.AllowUpdate = True
                frm转地调逐项操作票.DataGrid1.AllowArrows = False
           Else
                frm转地调逐项操作票.Command1.Enabled = False
                frm转地调逐项操作票.Command2.Enabled = False
                frm转地调逐项操作票.Command3.Enabled = False
                frm转地调逐项操作票.Command5.Enabled = False
                frm转地调逐项操作票.DataGrid1.AllowAddNew = False
                frm转地调逐项操作票.DataGrid1.AllowDelete = False
                frm转地调逐项操作票.DataGrid1.AllowUpdate = False
                frm转地调逐项操作票.DataGrid1.AllowArrows = False
           End If
        End If
                frm转地调逐项操作票.Command1.Enabled = False
                frm转地调逐项操作票.Command2.Enabled = False
                frm转地调逐项操作票.Command3.Enabled = False

        frm转地调逐项操作票.Command5.Enabled = False
        frm转地调逐项操作票.Text7.Text = ph
        frm转地调逐项操作票.Adodc1.RecordSource = "select * from xdgl_zzxczpfb where zxlph='" & ph & "'"
        Debug.Print frm转地调逐项操作票.Adodc1.RecordSource
        frm转地调逐项操作票.Adodc1.Refresh
        frm转地调逐项操作票.Adodc1.Recordset.MoveLast
        Call frm转地调逐项操作票.sx
        If RS.State Then
          RS.Close
        End If
        Call Close_link
  Else
      ph = Trim(DataGrid1.Columns(1).Value)
        Unload frm转地调综合操作票
        frm转地调综合操作票.Show
        frm转地调综合操作票.Move 0, 0, 11890, 7465
        Sql = "select * from xdgl_zzhczpzb where zlph='" & ph & "'"
        If RS.State Then
           RS.Close
        End If
        Call Open_link
        Set RS = ZHCX.Execute(Sql, 0)
        If Not RS.EOF Then
           frm转地调综合操作票.Combo1.Text = Trim(RS("npyj"))
           frm转地调综合操作票.Text1.Text = Trim(RS("npjtxm"))
           frm转地调综合操作票.Combo2.Text = Trim(RS("czdw"))
           frm转地调综合操作票.Text2.Text = Trim(RS("bz"))
           frm转地调综合操作票.Text4.Text = Trim(RS("czrw"))
           frm转地调综合操作票.DTPicker1.Value = Trim(RS("rq"))
           frm转地调综合操作票.DTPicker2.Value = Trim(RS("zxrq"))
           If IsNull(RS("zxjg")) Then
                frm转地调综合操作票.DataGrid1.AllowAddNew = False
                frm转地调综合操作票.DataGrid1.AllowDelete = False
                frm转地调综合操作票.DataGrid1.AllowUpdate = True
                frm转地调综合操作票.DataGrid1.AllowArrows = False
           Else
                frm转地调综合操作票.Command1.Enabled = False
                frm转地调综合操作票.Command2.Enabled = False
                frm转地调综合操作票.Command3.Enabled = False
                frm转地调综合操作票.DataGrid1.AllowAddNew = False
                frm转地调综合操作票.DataGrid1.AllowDelete = False
                frm转地调综合操作票.DataGrid1.AllowUpdate = False
                frm转地调综合操作票.DataGrid1.AllowArrows = False
           End If

        End If
        frm转地调综合操作票.Command1.Enabled = False
        frm转地调综合操作票.Command2.Enabled = False
        frm转地调综合操作票.Command3.Enabled = False
        frm转地调综合操作票.Command5.Enabled = False
        frm转地调综合操作票.Text3.Text = ph
        If RS.State Then
          RS.Close
        End If
        Call Close_link
        frm转地调综合操作票.Adodc1.RecordSource = "select * from xdgl_zzhczpfb where zlph like '%" & ph & "%'"
        Debug.Print frm转地调综合操作票.Adodc1.RecordSource
        frm转地调综合操作票.Adodc1.Refresh
        frm转地调综合操作票.DataGrid1.Refresh
        frm转地调综合操作票.Adodc1.Recordset.MoveLast
        Call frm转地调综合操作票.sx
  End If
  If Err Then Err.Clear

End If
End Sub


Private Sub Command4_Click()
    On Error Resume Next
Dim ph As String
If Adodc1.Recordset.EOF Then
  
Else
  If Option2.Value Then
      ph = Trim(DataGrid1.Columns(4).Value)
        Unload frm转地调逐项操作票
        frm转地调逐项操作票.Show
        frm转地调逐项操作票.Move 0, 0, 11890, 7465
        Sql = "select * from xdgl_zzxczpzb where zxlph='" & ph & "'"
        If RS.State Then
           RS.Close
        End If
        Call Open_link
        Set RS = ZHCX.Execute(Sql, 0)
        If Not RS.EOF Then
           frm转地调逐项操作票.Combo1.Text = Trim(RS("npyj"))
           frm转地调逐项操作票.Text1.Text = Trim(RS("jkbh"))
           frm转地调逐项操作票.Text3.Text = Trim(RS("czrw"))
           frm转地调逐项操作票.Text2.Text = Trim(RS("bz"))
           frm转地调逐项操作票.DTPicker2.Value = Trim(RS("zxsj"))
           If IsNull(RS("zxqk")) Then
                frm转地调逐项操作票.DataGrid1.AllowAddNew = False
                frm转地调逐项操作票.DataGrid1.AllowDelete = False
                frm转地调逐项操作票.DataGrid1.AllowUpdate = True
                frm转地调逐项操作票.DataGrid1.AllowArrows = False
           Else
                frm转地调逐项操作票.Command1.Enabled = False
                frm转地调逐项操作票.Command2.Enabled = True
                frm转地调逐项操作票.Command3.Enabled = True
                frm转地调逐项操作票.DataGrid1.AllowAddNew = False
                frm转地调逐项操作票.DataGrid1.AllowDelete = False
                frm转地调逐项操作票.DataGrid1.AllowUpdate = False
                frm转地调逐项操作票.DataGrid1.AllowArrows = False
           End If
        End If
        frm转地调逐项操作票.Command1.Enabled = False
        frm转地调逐项操作票.Command5.Enabled = True
        frm转地调逐项操作票.Text7.Text = ph
        frm转地调逐项操作票.Adodc1.RecordSource = "select * from xdgl_zzxczpfb where zxlph='" & ph & "'"
        frm转地调逐项操作票.Adodc1.Refresh
        If frm转地调逐项操作票.Adodc1.Recordset.EOF Then
        Else
            frm转地调逐项操作票.Adodc1.Recordset.MoveLast
        End If
        Call frm转地调逐项操作票.sx
        If RS.State Then
          RS.Close
        End If
        Call Close_link
  Else
      ph = DataGrid1.Columns(1).Value
        Unload frm转地调综合操作票
        frm转地调综合操作票.Show
        frm转地调综合操作票.Move 0, 0, 11890, 7465
        Sql = "select * from xdgl_zzhczpzb where zlph='" & ph & "'"
        If RS.State Then
           RS.Close
        End If
        Call Open_link
        Set RS = ZHCX.Execute(Sql, 0)
        If Not RS.EOF Then
           frm转地调综合操作票.Combo1.Text = Trim(RS("npyj"))
           frm转地调综合操作票.Text1.Text = Trim(RS("npjtxm"))
           frm转地调综合操作票.Combo2.Text = Trim(RS("czdw"))
           If Not IsNull(RS("bz")) Then
              frm转地调综合操作票.Text2.Text = Trim(RS("bz"))
           End If
           frm转地调综合操作票.Text4.Text = Trim(RS("czrw"))
           frm转地调综合操作票.DTPicker1.Value = Trim(RS("rq"))
           If Not IsNull(RS("zxrq")) Then
            frm转地调综合操作票.DTPicker2.Value = Trim(RS("zxrq"))
           End If
           If IsNull(RS("zxjg")) Then
                frm转地调综合操作票.DataGrid1.AllowAddNew = False
                frm转地调综合操作票.DataGrid1.AllowDelete = False
                frm转地调综合操作票.DataGrid1.AllowUpdate = True
                frm转地调综合操作票.DataGrid1.AllowArrows = False
           Else
                frm转地调综合操作票.Command1.Enabled = False
                frm转地调综合操作票.Command2.Enabled = True
                frm转地调综合操作票.Command3.Enabled = True
                frm转地调综合操作票.DataGrid1.AllowAddNew = False
                frm转地调综合操作票.DataGrid1.AllowDelete = False
                frm转地调综合操作票.DataGrid1.AllowUpdate = False
                frm转地调综合操作票.DataGrid1.AllowArrows = False
           End If

        End If
        frm转地调综合操作票.Command1.Enabled = False
        frm转地调综合操作票.Command5.Enabled = True
        frm转地调综合操作票.Text3.Text = ph
        If RS.State Then
          RS.Close
        End If
        Call Close_link
        frm转地调综合操作票.Adodc1.RecordSource = "select * from xdgl_zzhczpfb where zlph='" & ph & "'"
        frm转地调综合操作票.Adodc1.Refresh
        If frm转地调综合操作票.Adodc1.Recordset.EOF Then
        Else
            frm转地调综合操作票.Adodc1.Recordset.MoveLast
        End If
        Call frm转地调综合操作票.sx
  End If
  If Err Then Err.Clear

End If
End Sub


Private Sub DataGrid1_DblClick()
Call Command1_Click
End Sub

Private Sub DTPicker1_Change()
Call DTPicker2_Change
End Sub

Private Sub DTPicker2_Change()
Combo1.Text = ""
Combo2.Clear
  Call Open_link


 If Option1.Value Then

       Adodc1.RecordSource = "select * from xdgl_zzhczpzb where rq between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
   Adodc1.Refresh
   Call sx
Else
   Adodc1.RecordSource = "select * from xdgl_zzxczpzb where scsj between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
   Adodc1.Refresh
   Call cx
End If
    Set RS = ZHCX.Execute(Adodc1.RecordSource, 0)
         Do While Not RS.EOF
            If Option1.Value Then
                If Not IsNull(RS("zlph")) Then
                    Combo2.AddItem RS("zlph")
                End If
            Else
                If Not IsNull(RS("zxlph")) Then
                    Combo2.AddItem RS("zxlph")
                End If
            
            End If
           RS.MoveNext
         Loop
         If RS.State Then
            RS.Close
         End If
        Combo2.Text = ""
      Call sx
      
   Call Close_link

End Sub

Private Sub Form_Load()
On Error Resume Next
Adodc1.ConnectionString = "PROVIDER=MSDASQL;dsn=ddmis;uid=mis;pwd=mis005;database=zhcx"
DTPicker1.Value = Format(Now, "yyyy-mm-01")
DTPicker2.Value = DateAdd("d", -1, DateAdd("m", 1, Format(Now, "yyyy-mm-01")))
If Option1.Value Then
   plx = "xdgl_zzhczpzb"
   plx_1 = "zlph"
   plx_2 = "rq"

Else
   plx = "xdgl_zzxczpzb"
   plx_1 = "zxlph"
   plx_2 = "scsj"

End If

Combo1.Clear
Combo2.Clear
  
  Call Open_link
If Option1.Value Then
   sql1 = "select distinct czdw from xdgl_zzhczpzb where rq between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
Else
   sql1 = "select distinct czdw from xdgl_zzxczpzb where scsj between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "

End If
   
   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


          sql1 = "select " & plx_1 & " from " & plx & " where " & plx_2 & " between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "'"
    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
   Adodc1.RecordSource = "select * from " & plx & " where " & plx_2 & " between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "'"
   Adodc1.Refresh
   If Option1.Value Then
         Call sx
   Else
      Call cx
    End If
   Call Close_link
   
End Sub
Sub sx()
 DataGrid1.Columns(0).Visible = False
 DataGrid1.Columns(1).Caption = "票号"
 DataGrid1.Columns(1).Width = 1600
 DataGrid1.Columns(2).Visible = False
 DataGrid1.Columns(3).Visible = False
 DataGrid1.Columns(4).Visible = False
 DataGrid1.Columns(5).Visible = False
 DataGrid1.Columns(6).Visible = False
 DataGrid1.Columns(7).Caption = "操作任务"
 DataGrid1.Columns(7).Width = 4000
 DataGrid1.Columns(8).Visible = False
 DataGrid1.Columns(9).Visible = False
 DataGrid1.Columns(10).Visible = False
 End Sub
 Sub cx()
 DataGrid1.Columns(0).Visible = False
 DataGrid1.Columns(1).Visible = False
 DataGrid1.Columns(2).Visible = False
 DataGrid1.Columns(3).Visible = False
 DataGrid1.Columns(4).Caption = "票号"
 DataGrid1.Columns(4).Width = 1600
 DataGrid1.Columns(5).Visible = False
 DataGrid1.Columns(6).Visible = False
 DataGrid1.Columns(7).Caption = "操作任务"
 DataGrid1.Columns(7).Width = 4000
 DataGrid1.Columns(8).Visible = False
 DataGrid1.Columns(9).Visible = False
 DataGrid1.Columns(10).Visible = False
 DataGrid1.Columns(11).Visible = False
 DataGrid1.Columns(12).Visible = False
 End Sub

Private Sub Option1_Click()
 If Option1.Value Then
   Adodc1.RecordSource = "select * from xdgl_zzhczpzb where rq between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
   Adodc1.Refresh
   Call sx
Else
   Adodc1.RecordSource = "select * from xdgl_zzxczpzb where scsj between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
   Adodc1.Refresh
   Call cx
End If
Call Open_link
Combo1.Clear
  If Option1.Value Then
   sql1 = "select distinct czdw from xdgl_zzhczpzb where rq between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "
Else
   sql1 = "select distinct czdw from xdgl_zzxczpzb where scsj between  '" & Format(DTPicker1.Value, "yyyy-mm-dd") & "' and '" & Format(DTPicker2.Value, "yyyy-mm-dd") & "' "

End If
   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 Option2_Click()
Call Option1_Click
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -