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

📄 adjustamount.frm

📁 适合乡镇供电所使用电费处理系统v3 软件
💻 FRM
📖 第 1 页 / 共 3 页
字号:
             End If
       Else
            Set MdbR = NdMd.OpenRecordset("SELECT 用户电费.组合编码,用户电费.用户编码,用户电费.抄表码,用户电费.[" & AA & "] AS 本期示数 FROM 用户电费 WHERE trim(用户电费.镇村代码)='" & UserSeek & "' and trim(用户电费.抄表码)='" & Format(Trim(ListView1.SelectedItem.SubItems(1)), "000000") & "' order by 用户电费.抄表码 asc")
            MdbR.Edit
            MdbR.Fields!本期示数 = Format(Text5, "000000")
            MdbR.Update
            ListView1.SelectedItem.SubItems(4) = Format(Text5, "000000")
            Image1.Visible = True
            Frame2.Visible = False
       End If
   End If
   If KeyAscii = 27 Then
       Image1.Visible = True
       Frame2.Visible = False
   End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
   On Error Resume Next
   If KeyAscii = 13 Then
      If Len(Text6) > 0 Then
         Set MdbR = NdMd.OpenRecordset("SELECT 用户电费.组合编码,用户电费.用户编码,用户电费.抄表码,用户电费.[" & BB & "] AS 调整电量,用户电费.[" & EE & "] AS 调整金额 FROM 用户电费 WHERE trim(用户电费.镇村代码)='" & UserSeek & "' and trim(用户电费.抄表码)='" & Format(Trim(ListView1.SelectedItem.SubItems(1)), "000000") & "' order by 用户电费.抄表码 asc")
         MdbR.Edit
         MdbR.Fields!调整电量 = Val(Text6)
         MdbR.Update
         ListView1.SelectedItem.SubItems(6) = Val(Text6)
      End If
      Image1.Visible = True
      Frame2.Visible = False
   End If
   If KeyAscii = 27 Then
       Image1.Visible = True
       Frame2.Visible = False
   End If
End Sub

Private Sub Text7_KeyPress(KeyAscii As Integer)
   On Error Resume Next
   If KeyAscii = 13 Then
      If Len(Text7) <> 0 Then
         Set MdbR = NdMd.OpenRecordset("SELECT 用户电费.组合编码,用户电费.用户编码,用户电费.抄表码,用户电费.[" & BB & "] AS 调整电量,用户电费.[" & EE & "] AS 调整金额 FROM 用户电费 WHERE trim(用户电费.镇村代码)='" & UserSeek & "' and trim(用户电费.抄表码)='" & Format(Trim(ListView1.SelectedItem.SubItems(1)), "000000") & "' order by 用户电费.抄表码 asc")
         MdbR.Edit
         MdbR.Fields!调整金额 = Val(Text7)
         MdbR.Update
         ListView1.SelectedItem.SubItems(7) = Format(Text7, "0.00")
      End If
       Image1.Visible = True
       Frame2.Visible = False
   End If
   If KeyAscii = 27 Then
       Image1.Visible = True
       Frame2.Visible = False
   End If
End Sub

Sub RecoReg()
   On Error Resume Next
    Set MdbR = NdMd.OpenRecordset("SELECT 调整档案.镇村代码,调整档案.组合编码, 调整档案.用户表码, 调整档案.换前示数, 调整档案.换后示数, 调整档案.调整原因, 调整档案.旧表起度, 调整档案.旧表止度, 调整档案.换表人, 调整档案.换表日期, 调整档案.备注 FROM 调整档案")
    Set Mrs = NdMd.OpenRecordset("select 组合编码,用户编码,用户名称 from 用户电费 where 抄表码= '" & Format(Trim(ListView1.SelectedItem.SubItems(1)), "000000") & "'")
    MdbR.AddNew
    MdbR.Fields!镇村代码 = XzCode & XcCode
    MdbR.Fields!组合编码 = Mrs.Fields!组合编码
    MdbR.Fields!用户表码 = Format(Trim(ListView1.SelectedItem.SubItems(1)), "000000")
    MdbR.Fields!换前示数 = Format(Text3, "000000")
    MdbR.Fields!换后示数 = Format(Text4, "000000")
    MdbR.Fields!调整原因 = "换表"
    MdbR.Fields!旧表起度 = Format(Text1, "000000")
    MdbR.Fields!旧表止度 = Format(Text2, "000000")
    MdbR.Fields!换表人 = Operator
    MdbR.Fields!换表日期 = Format(Date, "YYYY年MM月DD日")
    MdbR.Update
End Sub

Private Sub Text8_KeyPress(KeyAscii As Integer)
  If KeyAscii = 13 Then
     Call Command6_Click
  End If
End Sub


Private Sub Command1_Click()
     Dim Quist As Integer
     On Error GoTo CommErr
    If pbUserPermission <> "系统管理员" Then
       MsgBox "您的权限不够,请于系统管理员联系!", vbInformation
       Exit Sub
    End If
     
     If Len(ListView1.SelectedItem.SubItems(8)) = 0 Then
        If Len(Trim(Str(Val(ListView1.SelectedItem.SubItems(4))))) < 3 Or Len(Trim(Str(Val(ListView1.SelectedItem.SubItems(4))))) = 3 Then   ' = 2 Or Len(Trim(Str(Val(ListView1.SelectedItem.SubItems(4))))) = 1
           MsgBox "该户电表为" & Len(Trim(Str(Val(ListView1.SelectedItem.SubItems(4))))) & "位表,该类电表不存在!", vbCritical
           Exit Sub
        End If
        Quist = MsgBox("请确认该用户电表为[翻转](Y/N)?    ", vbYesNo + 32, "请确认...")
        If Quist = 6 Then
           ListView1.SelectedItem.SubItems(8) = "翻转"
           Set Mrs = NdMd.OpenRecordset("SELECT 用户电费.调整原因,用户电费.组合编码,用户电费.用户编码,用户电费.抄表码,用户电费.用户名称,用户电费.镇村代码,用户电费.[" & 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(用户电费.抄表码)='" & Format(Trim(ListView1.SelectedItem.SubItems(1)), "000000") & "' order by 用户电费.抄表码 asc")
           Mrs.Edit
           Mrs.Fields!调整原因 = "翻转"
           Mrs.Update
           Set MdbR = NdMd.OpenRecordset("调整档案")
           With MdbR
                .AddNew
                .Fields!镇村代码 = UserSeek
                .Fields!组合编码 = Mrs.Fields!组合编码
                .Fields!用户表码 = Trim(ListView1.SelectedItem.SubItems(1))
                .Fields!调整原因 = "翻转"
                .Fields!换表人 = Operator
                .Fields!换表日期 = Format(Date, "yyyy-mm-dd")
                .Update
           End With
        End If
      Else
        Quist = MsgBox("请确认该用户电表取消[" & ListView1.SelectedItem.SubItems(8) & "](Y/N)?    ", vbYesNo + 32, "请确认...")
        If Quist = 6 Then
           ListView1.SelectedItem.SubItems(8) = ""
           Set MdbR = NdMd.OpenRecordset("SELECT 用户电费.镇村代码,用户电费.调整原因,用户电费.组合编码,用户电费.用户编码,用户电费.抄表码,用户电费.用户名称,用户电费.镇村代码,用户电费.[" & AAA & "] AS 上期示数, 用户电费.[" & AA & "] AS 本期示数,用户电费.表损, 用户电费.倍率,用户电费.[" & BB & "] AS 调整电量,用户电费.[" & CC & "] AS 本次电量, 用户电费.[" & DD & "] AS 合计电量,用户电费.电价,用户电费.[" & EE & "] AS 调整金额, 用户电费.[" & FF & "] AS 滞纳金, 用户电费.[" & GG & "] AS 本次电费, 用户电费.[" & HH & "] AS 合计电费,用户电费.[" & JJ & "] AS 发票打印,用户电费.[" & KK & "] AS 交费情况 From 用户电费 WHERE 用户电费.镇村代码='" & UserSeek & "' and 用户电费.抄表码= '" & Format(Trim(ListView1.SelectedItem.SubItems(1)), "000000") & "'")
           MdbR.Edit
           MdbR.Fields!调整原因 = ""
           MdbR.Update
'           Set Mrs = NdMd.OpenRecordset("select * from 调整档案 where 调整档案.镇村代码='" & UserSeek & "' and 调整档案.用户表码= '" & ListView1.SelectedItem & "'")
'           If Mrs.eof = False Then
'              Mrs.Delete
'           End If
        End If
     End If
     Exit Sub

CommErr:
     MsgBox Err.Description, vbCritical
     Exit Sub
End Sub

Private Sub Command2_Click()
    If pbUserPermission <> "系统管理员" Then
       MsgBox "您的权限不够,请于系统管理员联系!", vbInformation
       Exit Sub
    End If
       
       Image1.Visible = False
       Frame2.Visible = True
       Label1.Visible = True
       Label2.Visible = True
       Label3.Visible = True
       Label4.Visible = True
       Label5.Visible = False
       Label6.Visible = False
       Label7.Visible = False
       Text1.Visible = True
       Text2.Visible = True
       Text3.Visible = True
       Text4.Visible = True
       Text5.Visible = False
       Text6.Visible = False
       Text7.Visible = False
       Text1.SetFocus
End Sub

Private Sub Command3_Click()
    If pbUserPermission <> "系统管理员" Then
       MsgBox "您的权限不够,请于系统管理员联系!", vbInformation
       Exit Sub
    End If
     
     Frame2.Visible = True
     Label1.Visible = False
     Label2.Visible = False
     Label3.Visible = False
     Label4.Visible = False
     Label6.Visible = False
     Label7.Visible = False
     Label5.Visible = True
     Text1.Visible = False
     Text2.Visible = False
     Text3.Visible = False
     Text4.Visible = False
     Text6.Visible = False
     Text7.Visible = False
     Text5.Visible = True
     Text5.Text = ListView1.SelectedItem.SubItems(4)
     Text5.SetFocus
End Sub

Private Sub Command4_Click()
     Unload Me
End Sub

Private Sub Command5_Click()
     If pbUserPermission <> "系统管理员" Then
        MsgBox "您的权限不够,请于系统管理员联系!", vbInformation
        Exit Sub
     End If
     Frame2.Visible = True
     Label1.Visible = False
     Label2.Visible = False
     Label3.Visible = False
     Label4.Visible = False
     Label6.Visible = True
     Label7.Visible = True
     Label5.Visible = False
     Text1.Visible = False
     Text2.Visible = False
     Text3.Visible = False
     Text4.Visible = False
     Text6.Visible = True
     Text7.Visible = True
     Text5.Visible = False
     Text6.SetFocus
End Sub

Private Sub Command6_Click()
    Dim Seleitm As ListItem
    Dim strFindMe As String
    Dim intSelectedOption As Integer
   
    If Option1(0).Value = True Then
       strFindMe = Format(Trim(Text8), "0000")
       intSelectedOption = lvwText
    End If
    If Option1(1).Value = True Then
       strFindMe = Format(Trim(Text8), "000000")
       intSelectedOption = lvwSubItem
    End If
    If Option1(2).Value = True Then
       strFindMe = Text8
       intSelectedOption = lvwTag
    End If
    Set Seleitm = ListView1.FindItem(strFindMe, intSelectedOption, , 1)
    If Not (Seleitm Is Nothing) Then
       Seleitm.EnsureVisible
       Seleitm.Selected = True
       ListView1.SetFocus
    End If
       
End Sub

Private Sub Option1_Click(Index As Integer)
    On Error Resume Next
    Select Case Index
           Case 0
                If Option1(Index).Value = True Then
                   Text8 = ""
                   Text8.MaxLength = 6
                   Text8.SetFocus
                End If
           Case 1
                If Option1(Index).Value = True Then
                   Text8 = ""
                   Text8.MaxLength = 4
                   Text8.SetFocus
                End If
           Case 2
                If Option1(Index).Value = True Then
                   Text8 = ""
                   Text8.MaxLength = 50
                   Text8.SetFocus
                End If
    End Select
End Sub

⌨️ 快捷键说明

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