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

📄 inputrecord.frm

📁 适合乡镇供电所使用电费处理系统v3 软件
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form InputRecord 
   AutoRedraw      =   -1  'True
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "手工抄表"
   ClientHeight    =   6150
   ClientLeft      =   510
   ClientTop       =   1680
   ClientWidth     =   10035
   Icon            =   "InputRecord.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6150
   ScaleWidth      =   10035
   ShowInTaskbar   =   0   'False
   Begin MSComctlLib.ImageList ImageList1 
      Left            =   270
      Top             =   4200
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      ImageWidth      =   20
      ImageHeight     =   20
      MaskColor       =   12632256
      _Version        =   393216
      BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
         NumListImages   =   3
         BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "InputRecord.frx":08CA
            Key             =   ""
         EndProperty
         BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "InputRecord.frx":0E64
            Key             =   ""
         EndProperty
         BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
            Picture         =   "InputRecord.frx":13FE
            Key             =   ""
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton Command1 
      Caption         =   "关闭(&E)"
      Height          =   435
      Left            =   8715
      TabIndex        =   4
      Top             =   5580
      Width           =   1215
   End
   Begin MSComctlLib.ListView ListView1 
      Height          =   5370
      Left            =   75
      TabIndex        =   3
      Top             =   45
      Width           =   9885
      _ExtentX        =   17436
      _ExtentY        =   9472
      View            =   3
      LabelEdit       =   1
      Sorted          =   -1  'True
      LabelWrap       =   0   'False
      HideSelection   =   0   'False
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      Icons           =   "ImageList1"
      SmallIcons      =   "ImageList1"
      ForeColor       =   0
      BackColor       =   16777215
      BorderStyle     =   1
      Appearance      =   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      NumItems        =   9
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "电表编码"
         Object.Width           =   1940
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "用户编码"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "用户名称"
         Object.Width           =   2716
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "用户类型"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   4
         Text            =   "上期示数"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   5
         Text            =   "本期示数"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   6
         Text            =   "倍率"
         Object.Width           =   1412
      EndProperty
      BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   7
         Text            =   "电表状态"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   8
         Text            =   "序号"
         Object.Width           =   1058
      EndProperty
   End
   Begin VB.Frame Frame2 
      Height          =   660
      Left            =   105
      TabIndex        =   1
      Top             =   5430
      Width           =   8490
      Begin VB.OptionButton Option1 
         Caption         =   "按户名"
         Height          =   225
         Index           =   2
         Left            =   4395
         TabIndex        =   9
         Top             =   300
         Width           =   915
      End
      Begin VB.OptionButton Option1 
         Caption         =   "按户号"
         Height          =   225
         Index           =   1
         Left            =   3435
         TabIndex        =   8
         Top             =   300
         Width           =   930
      End
      Begin VB.OptionButton Option1 
         Caption         =   "按表号"
         Height          =   225
         Index           =   0
         Left            =   2445
         TabIndex        =   7
         Top             =   300
         Value           =   -1  'True
         Width           =   930
      End
      Begin VB.TextBox Text2 
         BackColor       =   &H00FFFF80&
         ForeColor       =   &H000000FF&
         Height          =   315
         Left            =   5310
         MaxLength       =   4
         TabIndex        =   6
         Top             =   225
         Width           =   2085
      End
      Begin VB.CommandButton Command2 
         Caption         =   "查找&S)"
         Height          =   345
         Left            =   7545
         TabIndex        =   5
         Top             =   225
         Width           =   825
      End
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   1125
         MaxLength       =   6
         TabIndex        =   0
         ToolTipText     =   "输入完毕请回车确认!"
         Top             =   225
         Width           =   1140
      End
      Begin VB.Label Label19 
         BackStyle       =   0  'Transparent
         Caption         =   "本期示数:"
         Height          =   255
         Left            =   135
         TabIndex        =   2
         Top             =   285
         Width           =   1215
      End
   End
End
Attribute VB_Name = "InputRecord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
   On Error Resume Next
   Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
   Dim intCounter, intRecCount As Integer
   Dim itm As ListItem
   Text1.BackColor = &HFFFF80
   OpenMdb
   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 & "'  order by 用户电费.用户编码")
   ListView1.View = lvwReport
   ListView1.SortKey = 0
   ListView1.SortOrder = lvwAscending
   If Not MdbR.eof Then
        MdbR.MoveLast
        MdbR.MoveFirst
        intRecCount = MdbR.RecordCount
        For intCounter = 0 To MdbR.RecordCount - 1
            If MdbR.Fields!用户类型 = "普通照明" Then
               Set itm = ListView1.ListItems.Add(, , CStr(MdbR!抄表码), , 1)
            Else
               Set itm = ListView1.ListItems.Add(, , CStr(MdbR!抄表码), , 3)
            End If
            itm.SubItems(1) = CStr(MdbR!用户编码) & ""
            itm.SubItems(2) = CStr(MdbR!用户名称) & ""
            itm.SubItems(3) = MdbR!用户类型 & ""
            itm.SubItems(4) = MdbR!上期示数 & ""
            itm.SubItems(5) = MdbR!本期示数 & ""
            itm.SubItems(6) = MdbR!倍率 & ""
            itm.SubItems(7) = MdbR!调整原因 & ""
            itm.SubItems(8) = MdbR!多表序号 & ""
            itm.Tag = CStr(Trim(MdbR!用户名称) & "")
            MdbR.MoveNext
            DoEvents
        Next intCounter
        ListView1.Sorted = True
        Option1(0).Value = True
   Else
        MsgBox XzName & XcName & "用户纪录为空!", vbCritical
        Unload Me
        Exit Sub
   End If
End Sub

Private Sub Command1_Click()
   Unload Me
End Sub

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

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
  On Error Resume Next
  If ListView1.SelectedItem.SubItems(5) = "" Then
     Text1.Enabled = True
     Text1 = ""
     Text1.SetFocus
  Else
     Text1 = ListView1.SelectedItem.SubItems(5)
  End If
End Sub

Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
 '排序
   On Error Resume Next
   ListView1.SortKey = ColumnHeader.Index - 1
   ListView1.Sorted = True
End Sub

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

Sub Text1_KeyPress(KeyAscii As Integer)
    On Error Resume Next
    Dim Length As Integer
    If KeyAscii = 13 Then
      If Text1.Text <> "" Then
         If Val(Text1) < Val(ListView1.SelectedItem.SubItems(4)) Then
            QuestionForm.Show vbModal
         Else
            Dim rct As String
            rct = ListView1.SelectedItem
            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 交费情况,用户电费.[" & LL & "] AS 计算 From 用户电费 WHERE  用户电费.镇村代码='" & UserSeek & "' and 用户电费.用户编码= '" & ListView1.SelectedItem.ListSubItems(1) & "' and 用户电费.抄表码= '" & rct & "'")
            If Not MdbR.NoMatch Then
                MdbR.Edit
                MdbR.Fields!本期示数 = Format(Text1, "000000")
                MdbR.Fields!计算 = False
                MdbR.Update
                ListView1.SelectedItem.SubItems(5) = Format(Text1, "000000")
                Text1 = ""
                Dim Item As ListItem, Index As Integer
                Index = ListView1.SelectedItem.Index
                Set Item = ListView1.FindItem(Mid(rct, 1, 3), , Index + 1, lvwPartial)
                If Not (Item Is Nothing) Then
                   Set ListView1.SelectedItem = Item
                   Item.EnsureVisible
                   Text1.SetFocus
                End If
            End If
         End If
      End If
   End If
   If KeyAscii = 27 Then
      ListView1.SetFocus
   End If
End Sub

Private Sub Text2_keyPress(KeyAscii As Integer)
   If KeyAscii = 13 Then
      Call Command2_Click
   End If
End Sub

⌨️ 快捷键说明

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