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

📄 frmdel.frm

📁 农村水电费记帐录入
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Begin VB.Form frmdel 
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "数据删除"
   ClientHeight    =   7290
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6285
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7290
   ScaleWidth      =   6285
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin CSCommand.Command Command1 
      Height          =   495
      Left            =   240
      TabIndex        =   15
      Top             =   6480
      Width           =   855
      _ExtentX        =   1508
      _ExtentY        =   873
      IconAlign       =   0
      Icon            =   "frmdel.frx":0000
      Caption         =   "返回"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00C0C000&
      BorderStyle     =   0  'None
      Height          =   6375
      Left            =   0
      Picture         =   "frmdel.frx":001C
      ScaleHeight     =   6375
      ScaleWidth      =   1215
      TabIndex        =   17
      Top             =   0
      Width           =   1215
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "数据删除"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000FFFF&
         Height          =   240
         Left            =   120
         TabIndex        =   18
         Top             =   2640
         Width           =   1020
      End
   End
   Begin CSCommand.Command cmdAsure 
      Height          =   495
      Left            =   1920
      TabIndex        =   16
      Top             =   6480
      Width           =   855
      _ExtentX        =   1508
      _ExtentY        =   873
      IconAlign       =   0
      Icon            =   "frmdel.frx":2843
      Caption         =   "确定删除"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   8
      Left            =   3840
      TabIndex        =   10
      Top             =   4200
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   7
      Left            =   3840
      TabIndex        =   9
      Top             =   3720
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   6
      Left            =   4680
      TabIndex        =   8
      Top             =   7785
      Visible         =   0   'False
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   5
      Left            =   3840
      TabIndex        =   7
      Top             =   3120
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   4
      Left            =   3840
      TabIndex        =   6
      Top             =   2640
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   3
      Left            =   4680
      TabIndex        =   5
      Top             =   7320
      Visible         =   0   'False
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   2
      Left            =   3840
      TabIndex        =   4
      Top             =   1440
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   1
      Left            =   3840
      TabIndex        =   3
      Top             =   885
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   0
      Left            =   3840
      TabIndex        =   2
      Top             =   360
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   9
      Left            =   3840
      TabIndex        =   1
      Top             =   4800
      Width           =   1695
   End
   Begin VB.TextBox txtUserName 
      Appearance      =   0  'Flat
      Height          =   375
      Index           =   10
      Left            =   3840
      TabIndex        =   0
      Top             =   5760
      Width           =   1695
   End
   Begin MSComCtl2.DTPicker dtpWdate 
      Height          =   375
      Left            =   3840
      TabIndex        =   11
      Top             =   2040
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   661
      _Version        =   393216
      Format          =   24838145
      CurrentDate     =   38393
   End
   Begin MSComCtl2.DTPicker DTPicker1 
      Height          =   375
      Left            =   3840
      TabIndex        =   12
      Top             =   5280
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   661
      _Version        =   393216
      Format          =   24838145
      CurrentDate     =   38393
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0C0C0&
      Height          =   6255
      Left            =   1320
      TabIndex        =   19
      Top             =   120
      Width           =   4695
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "抄录日期"
         Height          =   255
         Index           =   7
         Left            =   600
         TabIndex        =   30
         Top             =   5145
         Width           =   1095
      End
      Begin VB.Label Label6 
         BackStyle       =   0  'Transparent
         Caption         =   "当前欠费(元)"
         Height          =   255
         Left            =   600
         TabIndex        =   29
         Top             =   5640
         Width           =   1095
      End
      Begin VB.Label Label5 
         BackStyle       =   0  'Transparent
         Caption         =   "当前至码"
         Height          =   255
         Left            =   600
         TabIndex        =   28
         Top             =   4680
         Width           =   1095
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "用户姓名"
         Height          =   255
         Left            =   720
         TabIndex        =   27
         Top             =   720
         Width           =   1095
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "用户编号"
         Height          =   255
         Index           =   0
         Left            =   720
         TabIndex        =   26
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "上次至码"
         Height          =   255
         Left            =   720
         TabIndex        =   25
         Top             =   1305
         Width           =   1095
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "抄表日期"
         Height          =   255
         Index           =   1
         Left            =   720
         TabIndex        =   24
         Top             =   1905
         Width           =   1095
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "电价(元/度)"
         Height          =   255
         Index           =   3
         Left            =   600
         TabIndex        =   23
         Top             =   2880
         Width           =   1455
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "抄表人员"
         Height          =   255
         Index           =   5
         Left            =   600
         TabIndex        =   22
         Top             =   3480
         Width           =   1095
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "备    注"
         Height          =   255
         Index           =   6
         Left            =   600
         TabIndex        =   21
         Top             =   4080
         Width           =   1095
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "上次欠费"
         Height          =   255
         Left            =   720
         TabIndex        =   20
         Top             =   2400
         Width           =   735
      End
   End
   Begin VB.Label Label2 
      Caption         =   "营业电价(元/度)"
      Height          =   255
      Index           =   4
      Left            =   3000
      TabIndex        =   14
      Top             =   7800
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "照明占比(%)"
      Height          =   255
      Index           =   2
      Left            =   3240
      TabIndex        =   13
      Top             =   7440
      Visible         =   0   'False
      Width           =   1095
   End
End
Attribute VB_Name = "frmdel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdAdd_Click()
  If MsgBox("  你确定要删除该数据吗? ", vbInformation + vbYesNo) <> vbYes Then
    Exit Sub
  End If
 If Trim(MDIme.dcvalue.BoundText) <> "" Then
        Dim cnn As New ADODB.Connection
        Dim sqlAdd As String
        cnn.ConnectionString = cnn
        cnn.CursorLocation = adUseClient
        cnn.Open
        sqlAdd = "update  v_水电费记录 set 有效用户<>0"
        sqlAdd = sqlAdd & " where 姓名id='" & Trim(MDIme.dcvalue.BoundText) & "'"
        
        cnn.Execute sqlAdd
        cnn.Close
        MsgBox " 数据删除完成! ", vbInformation
    End If
End Sub

Private Sub Command1_Click()
For i = 0 To 10
    If i <> 9 Then
        MDIme.txtUserName(i) = ""
    End If
Next
MDIme.dcNum = ""
MDIme.dcvalue = ""
Unload Me
End Sub

Private Sub Form_Load()
Dim rst As New ADODB.Recordset
Dim sqlEdit As String
sqlEdit = "select * from v_水电费记录  "
sqlEdit = sqlEdit & " where 姓名id='" & Trim(MDIme.txtUserName(0)) & "' and 有效用户<>0 "
rst.Open sqlEdit, gCnn, adOpenKeyset, adLockBatchOptimistic
If Not rst.EOF Then

    txtUserName(0) = rst.Fields(1)
    txtUserName(1) = rst.Fields(2)
    txtUserName(2) = rst.Fields(3)
    dtpWdate.Value = rst.Fields(4)
    txtUserName(3) = rst.Fields(5)
    txtUserName(4) = Format(rst.Fields(6), "####0.00")
    txtUserName(5) = Format(rst.Fields(7), "####0.00")
    txtUserName(6) = rst.Fields(8)
    txtUserName(7) = rst.Fields(9)
    txtUserName(8) = rst.Fields(10)
    txtUserName(9) = rst.Fields!cendcode
    changeE = rst.Fields!cendcode
    cEcount = rst.Fields!nowecount
    If rst.Fields(14) <> Null Then
        DTPicker1.Value = rst.Fields(14)
    End If
    txtUserName(10) = rst.Fields!cFeeMoney
    
End If

 
rst.Close
End Sub

Private Sub Form_Unload(Cancel As Integer)
MDIme.loadAdd
End Sub

⌨️ 快捷键说明

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