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

📄 adduser.frm

📁 这是一套农村电费计算程序的源码。能够对用户电费进行计算、查询、打印。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form adduser 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "增加用户"
   ClientHeight    =   5835
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3255
   Icon            =   "adduser.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5835
   ScaleWidth      =   3255
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.TextBox Text7 
      Alignment       =   2  'Center
      Enabled         =   0   'False
      Height          =   375
      Left            =   1440
      TabIndex        =   26
      Top             =   840
      Width           =   1335
   End
   Begin VB.ComboBox Combo3 
      DataField       =   "dj"
      DataSource      =   "djsj"
      Height          =   300
      ItemData        =   "adduser.frx":0442
      Left            =   1440
      List            =   "adduser.frx":0444
      Style           =   2  'Dropdown List
      TabIndex        =   11
      Top             =   4200
      Width           =   1335
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      ItemData        =   "adduser.frx":0446
      Left            =   1440
      List            =   "adduser.frx":0456
      TabIndex        =   8
      Text            =   "5-20A"
      Top             =   3000
      Width           =   1335
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "adduser.frx":0475
      Left            =   1440
      List            =   "adduser.frx":0482
      TabIndex        =   7
      Text            =   "220V"
      Top             =   2640
      Width           =   1335
   End
   Begin VB.TextBox Text12 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   1440
      TabIndex        =   12
      Text            =   "0"
      Top             =   4560
      Width           =   1335
   End
   Begin VB.TextBox Text10 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   1440
      TabIndex        =   10
      Text            =   "1"
      Top             =   3720
      Width           =   1335
   End
   Begin VB.TextBox Text9 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   1440
      TabIndex        =   9
      Top             =   3360
      Width           =   1335
   End
   Begin VB.TextBox Text6 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   1440
      TabIndex        =   6
      Text            =   "9999"
      Top             =   2280
      Width           =   1335
   End
   Begin VB.TextBox Text5 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   1440
      TabIndex        =   5
      Text            =   "999999"
      Top             =   1920
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   1440
      TabIndex        =   4
      Text            =   "无"
      Top             =   1560
      Width           =   1335
   End
   Begin VB.TextBox Text3 
      Alignment       =   2  'Center
      Height          =   375
      Left            =   1440
      TabIndex        =   0
      Top             =   1200
      Width           =   1335
   End
   Begin VB.TextBox Text2 
      Alignment       =   2  'Center
      Enabled         =   0   'False
      Height          =   375
      Left            =   1440
      TabIndex        =   3
      Top             =   480
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      Alignment       =   2  'Center
      Enabled         =   0   'False
      Height          =   375
      Left            =   1440
      TabIndex        =   2
      Top             =   120
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "退 出"
      Height          =   375
      Left            =   2040
      TabIndex        =   13
      Top             =   5280
      Width           =   735
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确 定"
      Default         =   -1  'True
      Height          =   375
      Left            =   480
      TabIndex        =   1
      Top             =   5280
      Width           =   735
   End
   Begin VB.Label Label13 
      Caption         =   "户    号"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   480
      TabIndex        =   27
      Top             =   960
      Width           =   735
   End
   Begin VB.Label Label12 
      Caption         =   "新表起码"
      Height          =   255
      Left            =   480
      TabIndex        =   25
      Top             =   4680
      Width           =   735
   End
   Begin VB.Label Label11 
      Caption         =   "电    价"
      Height          =   255
      Left            =   480
      TabIndex        =   24
      Top             =   4200
      Width           =   735
   End
   Begin VB.Label Label10 
      Caption         =   "倍    率"
      Height          =   255
      Left            =   480
      TabIndex        =   23
      Top             =   3840
      Width           =   735
   End
   Begin VB.Label Label9 
      Caption         =   "装表日期"
      Height          =   255
      Left            =   480
      TabIndex        =   22
      Top             =   3480
      Width           =   735
   End
   Begin VB.Label Label8 
      Caption         =   "电 流 值"
      Height          =   255
      Left            =   480
      TabIndex        =   21
      Top             =   3120
      Width           =   735
   End
   Begin VB.Label Label7 
      Caption         =   "电压等级"
      Height          =   255
      Left            =   480
      TabIndex        =   20
      Top             =   2715
      Width           =   735
   End
   Begin VB.Label Label6 
      Caption         =   "局    号"
      Height          =   255
      Left            =   480
      TabIndex        =   19
      Top             =   2400
      Width           =   735
   End
   Begin VB.Label Label5 
      Caption         =   "电表厂号"
      Height          =   255
      Left            =   480
      TabIndex        =   18
      Top             =   2040
      Width           =   735
   End
   Begin VB.Label Label4 
      Caption         =   "地    址"
      Height          =   255
      Left            =   480
      TabIndex        =   17
      Top             =   1680
      Width           =   735
   End
   Begin VB.Label Label3 
      Caption         =   "用户名称"
      Height          =   255
      Left            =   480
      TabIndex        =   16
      Top             =   1320
      Width           =   735
   End
   Begin VB.Label Label2 
      Caption         =   "村    名"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   480
      TabIndex        =   15
      Top             =   600
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "配变编号"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   480
      TabIndex        =   14
      Top             =   240
      Width           =   735
   End
End
Attribute VB_Name = "adduser"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public sj As Database
Public bksj As Recordset
Public djsj As Recordset

Private Sub Command1_Click()
    If Text3.Text = "" Then
            ab = MsgBox("请 输 入 用 户 名 称 ", vbOKOnly + 16, "提示")
        Else
            tmp = "insert into bk (byqh,name,hh,hm,dz,ch,jh,dydj,dlz,zbrq,bl,dj,bybm,sybm,bh) values ('" + Text1 + "','" + Text2 + "','" + Text7 + "','" + Text3 + "','" + Text4 + "','" + Text5 + "','" + Text6 + "','" + Combo1.Text + "','" + Combo2.Text + "','" + Text9 + "'," + Text10 + "," + Combo3.Text + "," + Text12 + "," + Text12 + ",'" + string1(14) + "');"
            sj.Execute tmp
            sj.Close
            
            string1(1) = Text1
            string1(2) = Text2
            string1(3) = Text7
            string1(4) = Text3
            string1(5) = Text4
            string1(6) = Text5
            string1(7) = Text6
            string1(8) = Combo1.Text
            string1(9) = Combo2.Text
            string1(10) = Text9
            string1(11) = Text10
            string1(12) = Combo3.Text
            string1(13) = Text12
            boolean1(1) = True
            
            Unload Me
            
    End If

    
End Sub

Private Sub Command2_Click()
    boolean1(2) = False
    boolean1(1) = False
    Unload Me
End Sub

Private Sub Form_Load()
    tmp = App.Path + "\data\cjsj.mdb"
    Set sj = OpenDatabase(tmp, False, False, ";pwd=sunlm")
    Set djsj = sj.OpenRecordset("dj")
    While Not djsj.EOF '增加电价项目
        Combo3.AddItem djsj!dj
        djsj.MoveNext
    Wend
    Combo3.Text = Combo3.List(0)
 
    
    Text1 = string1(1) '变压器编号
    Text2 = string1(2) '村名
    tmp = "select hh  from bk " + "where byqh='" & Text1 + "' group by hh"
    Set bksj = sj.OpenRecordset(tmp)
    If bksj.RecordCount = 0 Then '自动生成户号
        Text7 = "0005"
      Else
        bksj.MoveLast
        If boolean1(1) = False Then
                ab = Trim(LTrim(Str(bksj!hh + 5)))
            Else
                ab = LTrim(Trim(Str(Val(string1(3)) + 5))) '继续增加时的处理(不退出界面时)
                boolean1(1) = False
        End If
        ab = IIf(Len(ab) = 2, "00" & ab, IIf(Len(ab) = 3, "0" + ab, IIf(Len(ab) = 1, "000" + ab, ab)))
        Text7 = ab
    End If
    
    Text9 = Date

End Sub

⌨️ 快捷键说明

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