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

📄 browseuser.frm

📁 适合乡镇供电所使用电费处理系统v3 软件
💻 FRM
📖 第 1 页 / 共 3 页
字号:
    If Text26 <> "" Then
       Call Text26_keyPress(13)
       Text26 = ""
    End If
End Sub

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
   Call BenQiDf(ListView2, Trim(Item.Text))
End Sub

Private Sub ListView3_ItemClick(ByVal Item As MSComctlLib.ListItem)
   Call YongHuActi(ListView4, Trim(Item.Text))
End Sub

Private Sub Option2_Click()
    Text25.Enabled = False
    Option2.Value = True
    Text26.Enabled = True
    Text26.SelStart = 0
    Text26.SelLength = Len(Text26)
    Text26.SetFocus
End Sub

Private Sub Option1_Click()
       Text26.Enabled = False
       Option1.Value = True
       Text25.Enabled = True
       Text25.SelStart = 0
       Text25.SelLength = Len(Text25)
       Text25.SetFocus
End Sub

Private Sub SSTab1_Click(PreviousTab As Integer)
     On Error Resume Next
     rs.MoveFirst
     Dim i As Integer
     Select Case SSTab1.Tab
            Case 0  '基本档案
                Set rs = NdMd.OpenRecordset("select 用户编码,用户名称 from 用户电费 where trim(镇村代码)='" & UserSeek & "' and 多表序号='" & 1 & "' order by 用户电费.组合编码 asc")
                Call CotrlDrig1(ListView3)
            Case 1  '电费
                Set rs = NdMd.OpenRecordset("SELECT 用户编码,用户名称 From 用户电费 WHERE trim(镇村代码)='" & UserSeek & "' and 多表序号='" & 1 & "' order by 用户电费.组合编码 asc")
                Call CotrlDrig1(ListView1)
     End Select
End Sub

Sub Text25_keyPress(KeyAscii As Integer)
    Dim Jqing As String, Mhing As String
    Dim Jqitm As ListItem, Mhitm As ListItem
    If KeyAscii = 13 Then
      If Text25.Text = "" Then
         MsgBox "查询代码不正确请重新输入!", vbCritical, Me.Caption
         Text25.SelStart = 0
         Text25.SelLength = Len(Text25)
         Text25.SetFocus
      Else
         Select Case SSTab1.Tab
                Case 0
                        If Check1.Value = 1 Then  '模糊
                           Mhing = Format(Trim(Text25.Text), "0000")
                           Set Mhitm = ListView3.FindItem(Mhing, , , lvwPartial)
                           Call NoFind(Mhitm, ListView3, ListView4, Text25)
                        Else                      '精确
                           Jqing = Trim(Text25.Text)
                           Set Jqitm = ListView3.FindItem(Jqing, , , lvwPartial)
                           Call NoFind(Jqitm, ListView3, ListView4, Text25)
                        End If
                 Case 1
                        If Check1.Value = 1 Then  '模糊
                           Mhing = Format(Trim(Text25.Text), "0000")
                           Set Mhitm = ListView1.FindItem(Mhing, , , lvwPartial)
                           Call NoFind(Mhitm, ListView1, ListView2, Text25)
                        Else
                           Jqing = Trim(Text25.Text)
                           Set Jqitm = ListView1.FindItem(Jqing, , , lvwPartial)
                           Call NoFind(Jqitm, ListView1, ListView2, Text25)
                        End If
               End Select
            End If
     End If
      If KeyAscii = 27 Then
         Label14.Visible = True
         Check1.Visible = False
         Text25.Visible = False
         Text26.Visible = False
         Text26.Enabled = False
         Option1.Visible = False
         Option2.Visible = False
         Command2.Enabled = True
      End If
End Sub

Sub Text26_keyPress(KeyAscii As Integer)
    On Error Resume Next
    Dim McRec As Recordset
    Dim Mcing As String, Dming As String
    Dim Mcitm As ListItem
    If KeyAscii = 13 Then
      If Text26.Text = "" Then
         MsgBox "该用户不存在或者输入不正确,请重新输入!", vbCritical, Me.Caption
      Else
         Select Case SSTab1.Tab
                Case 0
                   Mcing = Trim(Text26.Text)
                   Set McRec = NdMd.OpenRecordset("select * from 用户电费 where 用户名称='" & Mcing & "'")
                   Dming = Trim(McRec.Fields!用户编码)
                   Set Mcitm = ListView3.FindItem(Dming, , , lvwPartial)
                   Call NoFind(Mcitm, ListView3, ListView4, Text26)
                   McRec.Close
                Case 1
                   Mcing = Trim(Text26.Text)
                   Set McRec = NdMd.OpenRecordset("select * from 用户电费 where 用户名称='" & Mcing & "'")
                   Dming = Trim(McRec.Fields!用户编码)
                   Set Mcitm = ListView1.FindItem(Dming, , , lvwPartial)
                   Call NoFind(Mcitm, ListView1, ListView2, Text26)
                   McRec.Close
                End Select
              End If
            End If
            If KeyAscii = 27 Then
               Label14.Visible = True
               Check1.Visible = False
               Text25.Visible = False
               Text26.Visible = False
               Text26.Enabled = False
               Option1.Visible = False
               Option2.Visible = False
               Command2.Enabled = True
            End If
End Sub

Sub YongHuActi(Lis3 As ListView, Yhh As String)
    Dim YhRec As Recordset
    Dim itm As ListItem
    Lis3.ListItems.Clear
    Set YhRec = NdMd.OpenRecordset("select 多表序号 as 序号,辅助号,用户类型,相数标识 as 相数,用户名称,全称,地址,台区,电价代码,电价类别,停用,多价表,多表户,状态 from 用户电费 where 镇村代码 ='" & UserSeek & "' and trim(用户编码)='" & Yhh & "'order by 抄表码 asc")
    With Lis3
      While Not YhRec.eof
        Set itm = Lis3.ListItems.Add(, , CStr(YhRec.Fields!序号 & ""))
        If Trim(YhRec.Fields!辅助号) <> "" Then itm.SubItems(1) = YhRec.Fields!辅助号
        If Trim(YhRec.Fields!用户类型) <> "" Then itm.SubItems(2) = YhRec.Fields!用户类型
        If Trim(YhRec.Fields!相数) <> "" Then itm.SubItems(3) = YhRec.Fields!相数
        If Trim(YhRec.Fields!全称) <> "" Then itm.SubItems(4) = YhRec.Fields!全称
        If Trim(YhRec.Fields!地址) <> "" Then itm.SubItems(5) = YhRec.Fields!地址
        If Trim(YhRec.Fields!台区) <> "" Then itm.SubItems(6) = YhRec.Fields!台区
        If Trim(YhRec.Fields!电价代码) <> "" Then itm.SubItems(7) = YhRec.Fields!电价代码
        If Trim(YhRec.Fields!电价类别) <> "" Then itm.SubItems(8) = YhRec.Fields!电价类别
        itm.SubItems(9) = IIf(YhRec.Fields!停用 = True, "是", "否")
        itm.SubItems(10) = IIf(YhRec.Fields!多价表 = True, "是", "否")
        itm.SubItems(11) = IIf(YhRec.Fields!多表户 = True, "是", "否")
        If Trim(YhRec.Fields!状态) <> "" Then itm.SubItems(12) = YhRec.Fields!状态
        
        YhRec.MoveNext
      Wend
    End With
    Text25.Visible = False
    Text26.Visible = False
    Text26.Enabled = False
    Option1.Visible = False
    Option2.Visible = False
    Command2.Enabled = True
    Label14.Visible = True
    Check1.Visible = False
End Sub

Sub BenQiDf(Lis2 As ListView, Yhm As String)
    Dim DfRec As Recordset
    Dim itm As ListItem
    Lis2.Refresh
    Set DfRec = NdMd.OpenRecordset("SELECT 用户电费.多表序号 as 序号,用户电费.相数标识 as 相数,用户电费.[" & AAA & "] AS 上期, 用户电费.[" & AA & "] AS 本期,用户电费.表损, 用户电费.倍率,用户电费.[" & BB & "] AS 加减度,用户电费.[" & CC & "] AS 实用电量, 用户电费.[" & DD & "] AS 计费电量,用户电费.电价,用户电费.[" & EE & "] AS 调整金额, 用户电费.[" & FF & "] AS 滞纳金, 用户电费.[" & GG & "] AS 本次电费,用户电费.[" & HH & "] AS 合计电费,用户电费.[" & JJ & "] AS 发票打印,用户电费.[" & KK & "] AS 交费 From 用户电费 WHERE trim(用户电费.镇村代码)='" & UserSeek & "' and trim(用户电费.用户编码)='" & Yhm & "' order by 用户电费.抄表码 asc")
    Lis2.ListItems.Clear
    With Lis2
      While Not DfRec.eof
        Set itm = Lis2.ListItems.Add(, , CStr(DfRec.Fields!序号) & "")
        If Trim(DfRec.Fields!相数) <> "" Then itm.SubItems(1) = DfRec.Fields!相数
        If Trim(DfRec.Fields!上期) <> "" Then itm.SubItems(2) = DfRec.Fields!上期
        If Trim(DfRec.Fields!本期) <> "" Then itm.SubItems(3) = DfRec.Fields!本期
        If Trim(DfRec.Fields!表损) <> "" Then itm.SubItems(4) = DfRec.Fields!表损
        If Trim(DfRec.Fields!倍率) <> "" Then itm.SubItems(5) = DfRec.Fields!倍率
        If Trim(DfRec.Fields!加减度) <> "" Then itm.SubItems(6) = IIf(DfRec.Fields!加减度 = 0, "", DfRec.Fields!加减度)
        If Trim(DfRec.Fields!实用电量) <> "" Then itm.SubItems(7) = IIf(DfRec.Fields!实用电量 = 0, "", DfRec.Fields!实用电量)
        If Trim(DfRec.Fields!计费电量) <> "" Then itm.SubItems(8) = IIf(DfRec.Fields!计费电量 = 0, "", DfRec.Fields!计费电量)
        If Trim(DfRec.Fields!电价) <> "" Then itm.SubItems(9) = Format(DfRec.Fields!电价, "0.000")
        If Trim(DfRec.Fields!调整金额) <> "" Then itm.SubItems(10) = IIf(DfRec.Fields!调整金额 = 0, "", DfRec.Fields!调整金额)
        If Trim(DfRec.Fields!滞纳金) <> "" Then itm.SubItems(11) = IIf(Format(DfRec.Fields!滞纳金, "0.00") = 0, "", Format(DfRec.Fields!滞纳金, "0.00"))
        If Trim(DfRec.Fields!本次电费) <> "" Then itm.SubItems(12) = IIf(Format(DfRec.Fields!本次电费, "0.00") = 0, "", Format(DfRec.Fields!本次电费, "0.00"))
       ' If Trim(DfRec.Fields!电建基金) <> "" Then itm.SubItems(13) = IIf(Format(DfRec.Fields!电建基金, "0.00") = 0, "", Format(DfRec.Fields!电建基金, "0.00"))
       ' If Trim(DfRec.Fields!三峡基金) <> "" Then itm.SubItems(14) = IIf(Format(DfRec.Fields!三峡基金, "0.00") = 0, "", Format(DfRec.Fields!三峡基金, "0.00"))
        If Trim(DfRec.Fields!合计电费) <> "" Then itm.SubItems(15) = IIf(Format(DfRec.Fields!合计电费, "0.00") = 0, "", Format(DfRec.Fields!合计电费, "0.00"))
        itm.SubItems(16) = IIf(DfRec.Fields!发票打印 = True, "是", "否")
        itm.SubItems(17) = IIf(DfRec.Fields!交费 = True, "是", "否")
        DfRec.MoveNext
      Wend
    End With
        Text25.Visible = False
        Text26.Visible = False
        Text26.Enabled = False
        Option1.Visible = False
        Option2.Visible = False
        Command2.Enabled = True
        Label14.Visible = True
        Check1.Visible = False
End Sub

Sub CotrlDrig1(Lis1 As ListView)
    Dim intRecCount As Integer, intCounter As Integer
    Dim itm As ListItem
    Lis1.ListItems.Clear
    If Not rs.eof Then
      rs.MoveLast
      intRecCount = rs.RecordCount
      rs.MoveFirst
      For intCounter = 0 To rs.RecordCount - 1
        Set itm = Lis1.ListItems.Add(, , CStr(rs!用户编码 & ""))
        itm.SubItems(1) = rs!用户名称 & ""
        rs.MoveNext
      Next intCounter
      Lis1.Sorted = True
    Else
      MsgBox XzName & XcName & GzYue & "月数据纪录为空!", vbCritical
      Unload Me
      Exit Sub
    End If
End Sub

Sub NoFind(Citem As ListItem, lis4 As ListView, lis5 As ListView, tex As TextBox)
    If Not (Citem Is Nothing) Then
      If lis4.Name = "ListView3" Then
        Set lis4.SelectedItem = Citem
        Call YongHuActi(lis5, CStr(Citem))
      Else
        Set lis4.SelectedItem = Citem
        Call BenQiDf(lis5, CStr(Citem))
      End If
    Else
      MsgBox "该用户未找到,请核实是否输入有误!", vbCritical
      tex.SelStart = 0
      tex.SelLength = Len(Text25)
      tex.SetFocus
    End If
End Sub

⌨️ 快捷键说明

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