frm_live.frm
上传用户:xxdyjx888
上传日期:2022-06-01
资源大小:55k
文件大小:30k
源码类别:

家庭/个人应用

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
  4. Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
  5. Begin VB.Form frm_live 
  6.    Caption         =   "活期存款"
  7.    ClientHeight    =   5415
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   6375
  11.    Icon            =   "frm_live.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   5415
  15.    ScaleWidth      =   6375
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin TabDlg.SSTab SSTab1 
  18.       Height          =   5415
  19.       Left            =   0
  20.       TabIndex        =   0
  21.       Top             =   0
  22.       Width           =   6375
  23.       _ExtentX        =   11245
  24.       _ExtentY        =   9551
  25.       _Version        =   393216
  26.       Style           =   1
  27.       Tabs            =   2
  28.       Tab             =   1
  29.       TabHeight       =   520
  30.       BackColor       =   -2147483648
  31.       TabCaption(0)   =   "账户信息"
  32.       TabPicture(0)   =   "frm_live.frx":030A
  33.       Tab(0).ControlEnabled=   0   'False
  34.       Tab(0).Control(0)=   "Label8"
  35.       Tab(0).Control(0).Enabled=   0   'False
  36.       Tab(0).Control(1)=   "Label9"
  37.       Tab(0).Control(1).Enabled=   0   'False
  38.       Tab(0).Control(2)=   "Label10"
  39.       Tab(0).Control(2).Enabled=   0   'False
  40.       Tab(0).Control(3)=   "Label11"
  41.       Tab(0).Control(3).Enabled=   0   'False
  42.       Tab(0).Control(4)=   "Label12"
  43.       Tab(0).Control(4).Enabled=   0   'False
  44.       Tab(0).Control(5)=   "Label13"
  45.       Tab(0).Control(5).Enabled=   0   'False
  46.       Tab(0).Control(6)=   "Label14"
  47.       Tab(0).Control(6).Enabled=   0   'False
  48.       Tab(0).Control(7)=   "Label20"
  49.       Tab(0).Control(7).Enabled=   0   'False
  50.       Tab(0).Control(8)=   "Label21"
  51.       Tab(0).Control(8).Enabled=   0   'False
  52.       Tab(0).Control(9)=   "Label22"
  53.       Tab(0).Control(9).Enabled=   0   'False
  54.       Tab(0).Control(10)=   "Command1"
  55.       Tab(0).Control(10).Enabled=   0   'False
  56.       Tab(0).Control(11)=   "Command2"
  57.       Tab(0).Control(11).Enabled=   0   'False
  58.       Tab(0).Control(12)=   "Command3"
  59.       Tab(0).Control(12).Enabled=   0   'False
  60.       Tab(0).Control(13)=   "Command4"
  61.       Tab(0).Control(13).Enabled=   0   'False
  62.       Tab(0).Control(14)=   "Frame1"
  63.       Tab(0).Control(14).Enabled=   0   'False
  64.       Tab(0).Control(15)=   "txt_date"
  65.       Tab(0).Control(15).Enabled=   0   'False
  66.       Tab(0).Control(16)=   "txt_money1"
  67.       Tab(0).Control(16).Enabled=   0   'False
  68.       Tab(0).Control(17)=   "txt_name1"
  69.       Tab(0).Control(17).Enabled=   0   'False
  70.       Tab(0).Control(18)=   "txt_address1"
  71.       Tab(0).Control(18).Enabled=   0   'False
  72.       Tab(0).Control(19)=   "txt_man1"
  73.       Tab(0).Control(19).Enabled=   0   'False
  74.       Tab(0).Control(20)=   "txt_size1"
  75.       Tab(0).Control(20).Enabled=   0   'False
  76.       Tab(0).Control(21)=   "Command12"
  77.       Tab(0).Control(21).Enabled=   0   'False
  78.       Tab(0).Control(22)=   "Command13"
  79.       Tab(0).Control(22).Enabled=   0   'False
  80.       Tab(0).ControlCount=   23
  81.       TabCaption(1)   =   "取款记录"
  82.       TabPicture(1)   =   "frm_live.frx":0326
  83.       Tab(1).ControlEnabled=   -1  'True
  84.       Tab(1).Control(0)=   "Label15"
  85.       Tab(1).Control(0).Enabled=   0   'False
  86.       Tab(1).Control(1)=   "Combo1"
  87.       Tab(1).Control(1).Enabled=   0   'False
  88.       Tab(1).Control(2)=   "Frame2"
  89.       Tab(1).Control(2).Enabled=   0   'False
  90.       Tab(1).Control(3)=   "Command6"
  91.       Tab(1).Control(3).Enabled=   0   'False
  92.       Tab(1).Control(4)=   "Command7"
  93.       Tab(1).Control(4).Enabled=   0   'False
  94.       Tab(1).Control(5)=   "Command9"
  95.       Tab(1).Control(5).Enabled=   0   'False
  96.       Tab(1).Control(6)=   "Command10"
  97.       Tab(1).Control(6).Enabled=   0   'False
  98.       Tab(1).Control(7)=   "MSHFlexGrid1"
  99.       Tab(1).Control(7).Enabled=   0   'False
  100.       Tab(1).Control(8)=   "txt_key"
  101.       Tab(1).Control(8).Enabled=   0   'False
  102.       Tab(1).ControlCount=   9
  103.       Begin VB.CommandButton Command13 
  104.          Caption         =   "上一个"
  105.          Height          =   255
  106.          Left            =   -70800
  107.          TabIndex        =   54
  108.          Top             =   1920
  109.          Width           =   735
  110.       End
  111.       Begin VB.CommandButton Command12 
  112.          Caption         =   "下一个"
  113.          Height          =   255
  114.          Left            =   -71520
  115.          TabIndex        =   53
  116.          Top             =   1920
  117.          Width           =   735
  118.       End
  119.       Begin VB.TextBox txt_key 
  120.          Height          =   285
  121.          Left            =   120
  122.          TabIndex        =   49
  123.          Top             =   4800
  124.          Visible         =   0   'False
  125.          Width           =   615
  126.       End
  127.       Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1 
  128.          Height          =   2655
  129.          Left            =   120
  130.          TabIndex        =   48
  131.          Top             =   840
  132.          Width           =   6135
  133.          _ExtentX        =   10821
  134.          _ExtentY        =   4683
  135.          _Version        =   393216
  136.          AllowUserResizing=   1
  137.          BandDisplay     =   1
  138.          _NumberOfBands  =   1
  139.          _Band(0).Cols   =   2
  140.       End
  141.       Begin VB.CommandButton Command10 
  142.          Caption         =   "退出"
  143.          Height          =   375
  144.          Left            =   1440
  145.          TabIndex        =   39
  146.          Top             =   4200
  147.          Width           =   735
  148.       End
  149.       Begin VB.CommandButton Command9 
  150.          Caption         =   "删除"
  151.          Height          =   375
  152.          Left            =   600
  153.          TabIndex        =   38
  154.          Top             =   4200
  155.          Width           =   735
  156.       End
  157.       Begin VB.CommandButton Command7 
  158.          Caption         =   "存款"
  159.          Height          =   375
  160.          Left            =   600
  161.          TabIndex        =   37
  162.          Top             =   3720
  163.          Width           =   735
  164.       End
  165.       Begin VB.CommandButton Command6 
  166.          Caption         =   "取款"
  167.          Height          =   375
  168.          Left            =   1440
  169.          TabIndex        =   36
  170.          Top             =   3720
  171.          Width           =   735
  172.       End
  173.       Begin VB.Frame Frame2 
  174.          Height          =   1815
  175.          Left            =   2760
  176.          TabIndex        =   35
  177.          Top             =   3480
  178.          Width           =   3255
  179.          Begin MSComCtl2.DTPicker DTPicker2 
  180.             Height          =   300
  181.             Left            =   1080
  182.             TabIndex        =   46
  183.             Top             =   360
  184.             Width           =   1335
  185.             _ExtentX        =   2355
  186.             _ExtentY        =   529
  187.             _Version        =   393216
  188.             Format          =   64487425
  189.             CurrentDate     =   37817
  190.          End
  191.          Begin VB.CommandButton Command11 
  192.             Caption         =   "确定"
  193.             Height          =   375
  194.             Left            =   2520
  195.             TabIndex        =   42
  196.             Top             =   1320
  197.             Width           =   615
  198.          End
  199.          Begin VB.TextBox Text2 
  200.             Height          =   300
  201.             Left            =   1080
  202.             TabIndex        =   41
  203.             Top             =   1320
  204.             Width           =   1335
  205.          End
  206.          Begin VB.TextBox Text1 
  207.             Height          =   300
  208.             Left            =   1080
  209.             TabIndex        =   40
  210.             Top             =   840
  211.             Width           =   1335
  212.          End
  213.          Begin VB.Label Label19 
  214.             Caption         =   "元"
  215.             Height          =   255
  216.             Left            =   2520
  217.             TabIndex        =   47
  218.             Top             =   840
  219.             Width           =   495
  220.          End
  221.          Begin VB.Label Label18 
  222.             Caption         =   "经手人:"
  223.             Height          =   375
  224.             Left            =   120
  225.             TabIndex        =   45
  226.             Top             =   1320
  227.             Width           =   855
  228.          End
  229.          Begin VB.Label Label17 
  230.             Caption         =   "金额:"
  231.             Height          =   375
  232.             Left            =   120
  233.             TabIndex        =   44
  234.             Top             =   840
  235.             Width           =   615
  236.          End
  237.          Begin VB.Label Label16 
  238.             Caption         =   "存款日期:"
  239.             Height          =   375
  240.             Left            =   120
  241.             TabIndex        =   43
  242.             Top             =   360
  243.             Width           =   1095
  244.          End
  245.       End
  246.       Begin VB.ComboBox Combo1 
  247.          Height          =   315
  248.          Left            =   1440
  249.          Style           =   2  'Dropdown List
  250.          TabIndex        =   34
  251.          Top             =   360
  252.          Width           =   1455
  253.       End
  254.       Begin VB.TextBox txt_size1 
  255.          BackColor       =   &H80000000&
  256.          BorderStyle     =   0  'None
  257.          Height          =   300
  258.          Left            =   -70560
  259.          TabIndex        =   32
  260.          Top             =   1080
  261.          Width           =   1815
  262.       End
  263.       Begin VB.TextBox txt_man1 
  264.          BackColor       =   &H80000000&
  265.          BorderStyle     =   0  'None
  266.          Height          =   300
  267.          Left            =   -70560
  268.          TabIndex        =   31
  269.          Top             =   600
  270.          Width           =   975
  271.       End
  272.       Begin VB.TextBox txt_address1 
  273.          BackColor       =   &H80000000&
  274.          BorderStyle     =   0  'None
  275.          Height          =   300
  276.          Left            =   -73800
  277.          TabIndex        =   30
  278.          Top             =   2040
  279.          Width           =   2175
  280.       End
  281.       Begin VB.TextBox txt_name1 
  282.          BackColor       =   &H80000000&
  283.          BorderStyle     =   0  'None
  284.          Height          =   300
  285.          Left            =   -73800
  286.          TabIndex        =   29
  287.          Top             =   1560
  288.          Width           =   2175
  289.       End
  290.       Begin VB.TextBox txt_money1 
  291.          BackColor       =   &H80000000&
  292.          BorderStyle     =   0  'None
  293.          Height          =   300
  294.          Left            =   -73800
  295.          TabIndex        =   28
  296.          Top             =   1080
  297.          Width           =   615
  298.       End
  299.       Begin VB.TextBox txt_date 
  300.          BackColor       =   &H80000000&
  301.          BorderStyle     =   0  'None
  302.          Height          =   300
  303.          Left            =   -73800
  304.          TabIndex        =   27
  305.          Top             =   600
  306.          Width           =   975
  307.       End
  308.       Begin VB.Frame Frame1 
  309.          Height          =   3015
  310.          Left            =   -72840
  311.          TabIndex        =   5
  312.          Top             =   2280
  313.          Width           =   4095
  314.          Begin VB.CommandButton Command5 
  315.             Caption         =   "确定"
  316.             Height          =   375
  317.             Left            =   2880
  318.             TabIndex        =   18
  319.             Top             =   2520
  320.             Width           =   735
  321.          End
  322.          Begin VB.TextBox txt_man 
  323.             Height          =   300
  324.             Left            =   1200
  325.             TabIndex        =   11
  326.             Top             =   2520
  327.             Width           =   1335
  328.          End
  329.          Begin VB.TextBox txt_money 
  330.             Height          =   300
  331.             Left            =   1200
  332.             TabIndex        =   10
  333.             Top             =   2040
  334.             Width           =   1335
  335.          End
  336.          Begin VB.TextBox txt_size 
  337.             Height          =   300
  338.             Left            =   1200
  339.             TabIndex        =   9
  340.             Top             =   1560
  341.             Width           =   2655
  342.          End
  343.          Begin VB.TextBox txt_address 
  344.             Height          =   300
  345.             Left            =   1200
  346.             TabIndex        =   8
  347.             Top             =   1080
  348.             Width           =   2655
  349.          End
  350.          Begin VB.TextBox txt_name 
  351.             Height          =   270
  352.             Left            =   1200
  353.             TabIndex        =   7
  354.             Top             =   720
  355.             Width           =   2655
  356.          End
  357.          Begin MSComCtl2.DTPicker DTPicker1 
  358.             Height          =   300
  359.             Left            =   1200
  360.             TabIndex        =   6
  361.             Top             =   240
  362.             Width           =   1335
  363.             _ExtentX        =   2355
  364.             _ExtentY        =   529
  365.             _Version        =   393216
  366.             Format          =   64487425
  367.             CurrentDate     =   37817
  368.          End
  369.          Begin VB.Label Label7 
  370.             Caption         =   "元"
  371.             Height          =   255
  372.             Left            =   2640
  373.             TabIndex        =   19
  374.             Top             =   2160
  375.             Width           =   375
  376.          End
  377.          Begin VB.Label Label6 
  378.             Caption         =   "开户人:"
  379.             Height          =   255
  380.             Left            =   240
  381.             TabIndex        =   17
  382.             Top             =   2640
  383.             Width           =   855
  384.          End
  385.          Begin VB.Label Label5 
  386.             Caption         =   "开户金额:"
  387.             Height          =   255
  388.             Left            =   240
  389.             TabIndex        =   16
  390.             Top             =   2160
  391.             Width           =   975
  392.          End
  393.          Begin VB.Label Label4 
  394.             Caption         =   "银行账号:"
  395.             Height          =   375
  396.             Left            =   240
  397.             TabIndex        =   15
  398.             Top             =   1680
  399.             Width           =   1095
  400.          End
  401.          Begin VB.Label Label3 
  402.             Caption         =   "银行地址:"
  403.             Height          =   375
  404.             Left            =   240
  405.             TabIndex        =   14
  406.             Top             =   1200
  407.             Width           =   975
  408.          End
  409.          Begin VB.Label Label2 
  410.             Caption         =   "银行名称:"
  411.             Height          =   255
  412.             Left            =   240
  413.             TabIndex        =   13
  414.             Top             =   720
  415.             Width           =   975
  416.          End
  417.          Begin VB.Label Label1 
  418.             Caption         =   "开户日期:"
  419.             Height          =   255
  420.             Left            =   240
  421.             TabIndex        =   12
  422.             Top             =   240
  423.             Width           =   1095
  424.          End
  425.       End
  426.       Begin VB.CommandButton Command4 
  427.          Caption         =   "退    出"
  428.          Height          =   495
  429.          Left            =   -74640
  430.          TabIndex        =   4
  431.          Top             =   4320
  432.          Width           =   1335
  433.       End
  434.       Begin VB.CommandButton Command3 
  435.          Caption         =   "删除账户"
  436.          Height          =   495
  437.          Left            =   -74640
  438.          TabIndex        =   3
  439.          Top             =   3840
  440.          Width           =   1335
  441.       End
  442.       Begin VB.CommandButton Command2 
  443.          Caption         =   "修改账户信息"
  444.          Height          =   495
  445.          Left            =   -74640
  446.          TabIndex        =   2
  447.          Top             =   3360
  448.          Width           =   1335
  449.       End
  450.       Begin VB.CommandButton Command1 
  451.          Caption         =   "新开账户"
  452.          Height          =   495
  453.          Left            =   -74640
  454.          TabIndex        =   1
  455.          Top             =   2880
  456.          Width           =   1335
  457.       End
  458.       Begin VB.Label Label22 
  459.          Caption         =   "个账户"
  460.          Height          =   255
  461.          Left            =   -70680
  462.          TabIndex        =   52
  463.          Top             =   1560
  464.          Width           =   615
  465.       End
  466.       Begin VB.Label Label21 
  467.          Caption         =   "Label21"
  468.          Height          =   255
  469.          Left            =   -70920
  470.          TabIndex        =   51
  471.          Top             =   1560
  472.          Width           =   255
  473.       End
  474.       Begin VB.Label Label20 
  475.          Caption         =   "共有:"
  476.          Height          =   255
  477.          Left            =   -71520
  478.          TabIndex        =   50
  479.          Top             =   1560
  480.          Width           =   615
  481.       End
  482.       Begin VB.Label Label15 
  483.          Caption         =   "银行账号:"
  484.          Height          =   255
  485.          Left            =   240
  486.          TabIndex        =   33
  487.          Top             =   480
  488.          Width           =   975
  489.       End
  490.       Begin VB.Label Label14 
  491.          Caption         =   "元"
  492.          Height          =   255
  493.          Left            =   -72960
  494.          TabIndex        =   26
  495.          Top             =   1080
  496.          Width           =   375
  497.       End
  498.       Begin VB.Label Label13 
  499.          Caption         =   "银行账号:"
  500.          Height          =   375
  501.          Left            =   -71520
  502.          TabIndex        =   25
  503.          Top             =   1080
  504.          Width           =   975
  505.       End
  506.       Begin VB.Label Label12 
  507.          Caption         =   "开户人:"
  508.          Height          =   255
  509.          Left            =   -71520
  510.          TabIndex        =   24
  511.          Top             =   600
  512.          Width           =   975
  513.       End
  514.       Begin VB.Label Label11 
  515.          Caption         =   "银行地址:"
  516.          Height          =   375
  517.          Left            =   -74760
  518.          TabIndex        =   23
  519.          Top             =   2040
  520.          Width           =   975
  521.       End
  522.       Begin VB.Label Label10 
  523.          Caption         =   "银行名称:"
  524.          Height          =   255
  525.          Left            =   -74760
  526.          TabIndex        =   22
  527.          Top             =   1560
  528.          Width           =   975
  529.       End
  530.       Begin VB.Label Label9 
  531.          Caption         =   "开户金额:"
  532.          Height          =   375
  533.          Left            =   -74760
  534.          TabIndex        =   21
  535.          Top             =   1080
  536.          Width           =   975
  537.       End
  538.       Begin VB.Label Label8 
  539.          Caption         =   "开户日期:"
  540.          Height          =   255
  541.          Left            =   -74760
  542.          TabIndex        =   20
  543.          Top             =   600
  544.          Width           =   975
  545.       End
  546.    End
  547. End
  548. Attribute VB_Name = "frm_live"
  549. Attribute VB_GlobalNameSpace = False
  550. Attribute VB_Creatable = False
  551. Attribute VB_PredeclaredId = True
  552. Attribute VB_Exposed = False
  553. Dim Mydb As New ADODB.Recordset
  554. Dim Mydb1 As New ADODB.Recordset
  555. Dim Mydb2 As New ADODB.Recordset
  556. Dim Mydb3 As New ADODB.Recordset
  557. Dim Mydb4 As New ADODB.Recordset
  558. Dim Money As New ADODB.Recordset
  559. Dim Key1 As New ADODB.Recordset
  560. Dim Note As New ADODB.Recordset
  561. Dim Count1 As New ADODB.Recordset
  562. Dim AA As New ADODB.Recordset
  563. Dim BB As New ADODB.Recordset
  564. Dim Str_text As String
  565. Dim Balance As Integer
  566. Dim Panduan As Boolean
  567. Dim Panduan1 As Boolean
  568. Dim Yuen As Integer
  569. Private Sub Combo1_Click()
  570.              Call Wangge
  571. End Sub
  572. Private Sub Command1_Click()
  573.             Call Atrue
  574.             txt_money.Text = ""
  575.             txt_name.Text = ""
  576.             txt_address.Text = ""
  577.             txt_man.Text = ""
  578.             txt_size.Text = ""
  579.             DTPicker1.Value = Date
  580.             Panduan1 = True
  581. End Sub
  582. Private Sub Command10_Click()
  583.             Unload Me
  584. End Sub
  585. Private Sub Command11_Click()
  586.             On Error Resume Next
  587.             Dim A, B, C, D, E, F, Key
  588.             
  589.             Set Count1 = ExeCutesql("select key from 活期存取", Str_text)
  590.             If Count1.EOF Then
  591.                E = Null
  592.             End If
  593.             If IsNull(E) Then
  594.                Key = 1
  595.             Else
  596.                Count1.MoveLast
  597.                Key = Count1.Fields(0) + 1
  598.             End If
  599.             
  600.             Set Note = ExeCutesql("select  余额 from  活期存取 ", Str_text)
  601.             If Note.EOF Then
  602.                D = Null
  603.             End If
  604.             
  605.             If IsNull(D) Then
  606.                Set Money = ExeCutesql("select 款额 from 活期帐户 where 银行帐号='" & Combo1.Text & "'", Str_text)
  607.                C = Money.Fields(0)
  608.                Balance = C
  609.             Else
  610.                Note.MoveLast
  611.                Balance = Note.Fields(0)
  612.             End If
  613.             
  614.                If Len(Combo1.Text) = 0 Then
  615.                   MsgBox "请选择银行账号!", vbOKOnly + 32
  616.                End If
  617.                A = MsgBox("是否添加此条记录?", vbYesNo + 32, "添加记录")
  618.                If A = vbYes Then
  619.                   If Panduan = True Then
  620.                      Balance = Balance - CInt(Text1.Text)
  621.                      ExeCutesql "insert into 活期存取 values('" & Combo1.Text & "','取款'," & Text1.Text & ",'" _
  622.                      & Format(DTPicker2.Value, "yyyy-mm-dd") & "','" & Text2.Text & "','" & Balance & "','" & Key & "')", Str_text
  623.                      Call Wangge
  624.                      Text1.Enabled = False
  625.                      Text2.Enabled = False
  626.                      Text1.Text = ""
  627.                      Text2.Text = ""
  628.                      MsgBox "数据添加成功!", vbOKOnly, "成功"
  629.                   Else
  630.                      Balance = Balance + CInt(Text1.Text)
  631.                      ExeCutesql "insert into 活期存取 values('" & Combo1.Text & "','存款'," & Text1.Text & ",'" _
  632.                      & Format(DTPicker2.Value, "yyyy-mm-dd") & "','" & Text2.Text & "','" & Balance & "','" & Key & "')", Str_text
  633.                      Call Wangge
  634.                      Text1.Enabled = False
  635.                      Text2.Enabled = False
  636.                      Text1.Text = ""
  637.                      Text2.Text = ""
  638.                      MsgBox "数据添加成功!", vbOKOnly, "成功"
  639.                  End If
  640.                End If
  641.                Command11.Enabled = False
  642. End Sub
  643. Private Sub Command12_Click()
  644.             On Error Resume Next
  645.             Mydb.MoveNext
  646.             If Mydb.EOF Then
  647.                Mydb.MoveLast
  648.             End If
  649. End Sub
  650. Private Sub Command13_Click()
  651.             On Error Resume Next
  652.             Mydb.MovePrevious
  653.             If Mydb.BOF Then
  654.                Mydb.MoveFirst
  655.             End If
  656. End Sub
  657. Private Sub Command2_Click()
  658.             Call Atrue
  659.             Panduan1 = False
  660. End Sub
  661. Private Sub Command3_Click()
  662.             Dim A
  663.              A = MsgBox("是否删除当前记录?", vbYesNo + 32 + 256, "删除记录")
  664.             If A = vbYes Then
  665.                If Mydb.EOF Then
  666.                   Call Bangding
  667.                   Exit Sub
  668.                Else
  669.                   Mydb.Delete
  670.                End If
  671.             End If
  672.             Call Bangding
  673. End Sub
  674. Private Sub Command4_Click()
  675.             Unload Me
  676. End Sub
  677. Private Sub Command5_Click()
  678.             Dim A, B
  679.             If Panduan1 = True Then
  680.                A = MsgBox("是否添加此记录?", vbYesNo + 32, "")
  681.                If A = vbYes Then
  682.                   ExeCutesql "insert into 活期帐户 values('" & Format(DTPicker1.Value, "yyyy-mm-dd") & "','" _
  683.                   & txt_name.Text & "','" & txt_address.Text & "','" & txt_size.Text _
  684.                   & "'," & CCur(txt_money.Text) & " ,'" & txt_man.Text & "') ", Str_text
  685.                   Call Bangding
  686.                   Call Afalse
  687.                End If
  688.             Else
  689.                B = MsgBox("是否修改前记录?", vbYesNo + 32, "添加记录")
  690.                If B = vbYes Then
  691.                   ExeCutesql "Update 活期帐户 Set 开户日期 ='" & Format(DTPicker1.Value, "yyyy-mm-dd") & "',银行名称='" _
  692.                   & txt_name.Text & "',银行地址='" & txt_address.Text & "',银行帐号 ='" & txt_size.Text _
  693.                   & "',款额=" & CCur(txt_money.Text) & " ,开户人='" & txt_man.Text & "'", Str_text
  694.                   Call Bangding
  695.                   Call Afalse
  696.                   MsgBox "Update 活期帐户 Set 开户日期 ='" & Format(DTPicker1.Value, "yyyy-mm-dd") & "',银行名称='" _
  697.                   & txt_name.Text & "',银行地址='" & txt_address.Text & "',银行帐号 ='" & txt_size.Text _
  698.                   & "',款额=" & CCur(txt_money.Text) & " ,开户人='" & txt_man.Text & "'"
  699.                   MsgBox "数据修改成功!", vbOKOnly + 64, "成功"
  700.                End If
  701.             End If
  702. End Sub
  703. Private Sub Command6_Click()
  704.             Panduan = True
  705.             Command11.Enabled = True
  706.             Text1.Enabled = True
  707.             Text2.Enabled = True
  708. End Sub
  709. Private Sub Command7_Click()
  710.             Panduan = False
  711.             Command11.Enabled = True
  712.             Text1.Enabled = True
  713.             Text2.Enabled = True
  714. End Sub
  715. Private Sub Command9_Click()
  716.             On Error Resume Next
  717.             Dim A, B, C, I, Ab, Bc, CC
  718.             
  719.             Bc = CInt(txt_key.Text)
  720.            
  721.             Set AA = ExeCutesql("select key from 活期存取", Str_text)
  722.             If AA.EOF Then
  723.                Exit Sub
  724.             End If
  725.             AA.MoveLast
  726.             C = AA.Fields(0)
  727.             B = C - Bc
  728.             
  729.             A = MsgBox("是否删除当前记录?", vbYesNo + 32 + 256, "添加记录")
  730.             If A = vbYes Then
  731.                ExeCutesql "delete from 活期存取 where key=" & txt_key.Text & " ", Str_text
  732.                For I = Bc To C
  733.                    Set BB = ExeCutesql("select 余额 from 活期存取 where key=" & I & " ", Str_text)
  734.                    'If BB.EOF Then Exit Sub
  735.                    Ab = BB.Fields(0)
  736.                    CC = Ab - CInt(Text1.Text)
  737.                    'MsgBox CC
  738.                    ExeCutesql "update 活期存取 set 余额=" & CC & " where key = " & I & "", Str_text
  739.                    'MsgBox "update 活期存取 set 余额=" & CC & " where key = " & I & ""
  740.                Next I
  741.                Call Wangge
  742.                Call MSHFlexGrid1_Click
  743.             End If
  744. End Sub
  745. Private Sub Form_Load()
  746.             On Error Resume Next
  747.             Dim A As Integer
  748.                            
  749.             Set Mydb3 = ExeCutesql("select sum(数目) from 活期存取", Str_text)
  750.             Balance = Mydb3.Fields(0)
  751.             Call Bangding
  752.             Call Afalse
  753.             Command11.Enabled = False
  754.             Text1.Enabled = False
  755.             Text2.Enabled = False
  756.             DTPicker1.Value = Date
  757.             DTPicker2.Value = Date
  758.             
  759. End Sub
  760. Private Sub MSHFlexGrid1_Click()
  761.             On Error Resume Next
  762.             DTPicker2.Value = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 1)
  763.             Text1.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 4)
  764.             Text2.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)
  765.             txt_key.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 6)
  766.             'Yuen = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 5)
  767. End Sub
  768. Private Sub SSTab1_Click(PreviousTab As Integer)
  769.             On Error Resume Next
  770.             Dim A As Integer
  771.             
  772.             If SSTab1.Caption = "取款记录" Then
  773.                Set Mydb1 = ExeCutesql("select 银行帐号 from 活期帐户", Str_text)
  774.                A = Mydb1.RecordCount
  775.                For I = 1 To A
  776.                    Combo1.AddItem Mydb1.Fields(0)
  777.                    Mydb1.MoveNext
  778.                    If Mydb1.EOF Then Exit For
  779.                Next I
  780.             End If
  781. End Sub
  782. Private Sub Text1_LostFocus()
  783.             Dim A As Boolean
  784.             Dim C
  785.             
  786.             C = Text1.Text
  787.             A = IsNumeric(C)
  788.             
  789.             If C = "" Then
  790.                MsgBox "请输入金额!", vbOKOnly + 32, "注意!"
  791.                Text1.SetFocus
  792.             Else
  793.                If A = False Then
  794.                   MsgBox "金额只能输入数字!", vbOKOnly + 32, "注意!"
  795.                   Text1.SetFocus
  796.                End If
  797.             End If
  798. End Sub
  799. Private Sub txt_money_LostFocus()
  800.             Dim A As Boolean
  801.             Dim C
  802.             
  803.             C = txt_money.Text
  804.             A = IsNumeric(C)
  805.             
  806.             If C = "" Then
  807.                MsgBox "请输入金额!", vbOKOnly + 32, "注意!"
  808.                txt_money.SetFocus
  809.             Else
  810.                If A = False Then
  811.                   MsgBox "金额只能输入数字!", vbOKOnly + 32, "注意!"
  812.                   txt_money.SetFocus
  813.                End If
  814.             End If
  815. End Sub
  816. Private Function Bangding()
  817.                  On Error Resume Next
  818.                  Set Mydb = ExeCutesql("select * from 活期帐户", Str_text)
  819.                  Mydb.MoveFirst
  820.                  Set txt_date.DataSource = Mydb
  821.                  Set txt_money1.DataSource = Mydb
  822.                  Set txt_name1.DataSource = Mydb
  823.                  Set txt_address1.DataSource = Mydb
  824.                  Set txt_man1.DataSource = Mydb
  825.                  Set txt_size1.DataSource = Mydb
  826.                  txt_date.DataField = "开户日期"
  827.                  txt_money1.DataField = "款额"
  828.                  txt_name1.DataField = "银行名称"
  829.                  txt_address1.DataField = "银行地址"
  830.                  txt_man1.DataField = "开户人"
  831.                  txt_size1.DataField = "银行帐号"
  832.                  Label21.Caption = Mydb.RecordCount
  833.                  
  834. End Function
  835. Private Function Atrue()
  836.                  txt_money.Locked = False
  837.                  txt_name.Locked = False
  838.                  txt_address.Locked = False
  839.                  txt_man.Locked = False
  840.                  txt_size.Locked = False
  841.                  Command5.Enabled = True
  842. End Function
  843. Private Function Afalse()
  844.                  txt_money.Locked = True
  845.                  txt_name.Locked = True
  846.                  txt_address.Locked = True
  847.                  txt_man.Locked = True
  848.                  txt_size.Locked = True
  849.                  Command5.Enabled = False
  850. End Function
  851. Private Function Wangge()
  852.                  Set Mydb2 = ExeCutesql("select 日期, 姓名, 存取,数目,余额,key from 活期存取 where 帐号='" & Combo1.Text & "'", Str_text)
  853.                  Set MSHFlexGrid1.DataSource = Mydb2
  854. End Function