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

家庭/个人应用

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomct2.ocx"
  3. Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
  4. Begin VB.Form frm_fix 
  5.    BackColor       =   &H80000000&
  6.    Caption         =   "定期存款"
  7.    ClientHeight    =   5505
  8.    ClientLeft      =   60
  9.    ClientTop       =   345
  10.    ClientWidth     =   8790
  11.    Icon            =   "frm_fix.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   5505
  15.    ScaleWidth      =   8790
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.CommandButton cmd_quit 
  18.       BackColor       =   &H000080FF&
  19.       Caption         =   "退出"
  20.       Height          =   375
  21.       Left            =   5160
  22.       TabIndex        =   21
  23.       Top             =   4920
  24.       Width           =   855
  25.    End
  26.    Begin VB.CommandButton cmd_del 
  27.       BackColor       =   &H000080FF&
  28.       Caption         =   "删除"
  29.       Height          =   375
  30.       Left            =   4320
  31.       TabIndex        =   20
  32.       Top             =   4920
  33.       Width           =   855
  34.    End
  35.    Begin VB.CommandButton cmd_edit 
  36.       BackColor       =   &H000080FF&
  37.       Caption         =   "修改"
  38.       Height          =   375
  39.       Left            =   3480
  40.       TabIndex        =   19
  41.       Top             =   4920
  42.       Width           =   855
  43.    End
  44.    Begin VB.CommandButton cmd_add 
  45.       BackColor       =   &H000080FF&
  46.       Caption         =   "添加"
  47.       Height          =   375
  48.       Left            =   2640
  49.       TabIndex        =   18
  50.       Top             =   4920
  51.       Width           =   855
  52.    End
  53.    Begin VB.Frame Frame1 
  54.       Height          =   1815
  55.       Left            =   0
  56.       TabIndex        =   1
  57.       Top             =   0
  58.       Width           =   8775
  59.       Begin VB.ComboBox Combo1 
  60.          Height          =   300
  61.          Left            =   6240
  62.          Style           =   2  'Dropdown List
  63.          TabIndex        =   23
  64.          Top             =   960
  65.          Width           =   1110
  66.       End
  67.       Begin VB.TextBox txt_key 
  68.          Height          =   270
  69.          Left            =   6480
  70.          TabIndex        =   22
  71.          Text            =   "Text1"
  72.          Top             =   1440
  73.          Visible         =   0   'False
  74.          Width           =   735
  75.       End
  76.       Begin VB.CheckBox Check1 
  77.          BackColor       =   &H80000000&
  78.          Caption         =   "已取"
  79.          ForeColor       =   &H000000FF&
  80.          Height          =   255
  81.          Left            =   5280
  82.          TabIndex        =   17
  83.          Top             =   1320
  84.          Width           =   855
  85.       End
  86.       Begin VB.TextBox txt_money 
  87.          Height          =   270
  88.          Left            =   6240
  89.          TabIndex        =   11
  90.          Top             =   240
  91.          Width           =   735
  92.       End
  93.       Begin VB.TextBox txt_time 
  94.          Height          =   270
  95.          Left            =   6240
  96.          TabIndex        =   10
  97.          Top             =   600
  98.          Width           =   495
  99.       End
  100.       Begin VB.TextBox txt_name 
  101.          Height          =   270
  102.          Left            =   1680
  103.          TabIndex        =   6
  104.          Top             =   600
  105.          Width           =   2655
  106.       End
  107.       Begin VB.TextBox txt_address 
  108.          Height          =   270
  109.          Left            =   1680
  110.          TabIndex        =   5
  111.          Top             =   960
  112.          Width           =   2655
  113.       End
  114.       Begin VB.TextBox txt_size 
  115.          Height          =   270
  116.          Left            =   1680
  117.          TabIndex        =   4
  118.          Top             =   1320
  119.          Width           =   2655
  120.       End
  121.       Begin MSComCtl2.DTPicker DTPicker1 
  122.          Height          =   300
  123.          Left            =   1680
  124.          TabIndex        =   2
  125.          Top             =   240
  126.          Width           =   1335
  127.          _ExtentX        =   2355
  128.          _ExtentY        =   529
  129.          _Version        =   393216
  130.          Format          =   64487425
  131.          CurrentDate     =   37856
  132.       End
  133.       Begin VB.Label Label8 
  134.          BackStyle       =   0  'Transparent
  135.          Caption         =   "存款人:"
  136.          Height          =   255
  137.          Left            =   5280
  138.          TabIndex        =   16
  139.          Top             =   960
  140.          Width           =   855
  141.       End
  142.       Begin VB.Label Label5 
  143.          BackStyle       =   0  'Transparent
  144.          Caption         =   "金额:"
  145.          Height          =   255
  146.          Left            =   5280
  147.          TabIndex        =   15
  148.          Top             =   240
  149.          Width           =   615
  150.       End
  151.       Begin VB.Label Label6 
  152.          BackStyle       =   0  'Transparent
  153.          Caption         =   "元"
  154.          Height          =   255
  155.          Left            =   7080
  156.          TabIndex        =   14
  157.          Top             =   240
  158.          Width           =   255
  159.       End
  160.       Begin VB.Label Label11 
  161.          BackStyle       =   0  'Transparent
  162.          Caption         =   "月"
  163.          Height          =   255
  164.          Left            =   6840
  165.          TabIndex        =   13
  166.          Top             =   600
  167.          Width           =   615
  168.       End
  169.       Begin VB.Label Label12 
  170.          BackStyle       =   0  'Transparent
  171.          Caption         =   "期限:"
  172.          Height          =   255
  173.          Left            =   5280
  174.          TabIndex        =   12
  175.          Top             =   600
  176.          Width           =   735
  177.       End
  178.       Begin VB.Label Label2 
  179.          BackStyle       =   0  'Transparent
  180.          Caption         =   "银行名称:"
  181.          Height          =   255
  182.          Left            =   600
  183.          TabIndex        =   9
  184.          Top             =   600
  185.          Width           =   1215
  186.       End
  187.       Begin VB.Label Label3 
  188.          BackStyle       =   0  'Transparent
  189.          Caption         =   "银行地址:"
  190.          Height          =   255
  191.          Left            =   600
  192.          TabIndex        =   8
  193.          Top             =   960
  194.          Width           =   1095
  195.       End
  196.       Begin VB.Label Label4 
  197.          BackStyle       =   0  'Transparent
  198.          Caption         =   "银行账号:"
  199.          Height          =   255
  200.          Left            =   600
  201.          TabIndex        =   7
  202.          Top             =   1320
  203.          Width           =   1095
  204.       End
  205.       Begin VB.Label Label1 
  206.          Caption         =   "存款日期:"
  207.          Height          =   255
  208.          Left            =   600
  209.          TabIndex        =   3
  210.          Top             =   240
  211.          Width           =   1095
  212.       End
  213.    End
  214.    Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1 
  215.       Height          =   2775
  216.       Left            =   0
  217.       TabIndex        =   0
  218.       Top             =   1920
  219.       Width           =   8775
  220.       _ExtentX        =   15478
  221.       _ExtentY        =   4895
  222.       _Version        =   393216
  223.       AllowUserResizing=   1
  224.       _NumberOfBands  =   1
  225.       _Band(0).Cols   =   2
  226.    End
  227. End
  228. Attribute VB_Name = "frm_fix"
  229. Attribute VB_GlobalNameSpace = False
  230. Attribute VB_Creatable = False
  231. Attribute VB_PredeclaredId = True
  232. Attribute VB_Exposed = False
  233. Dim Mydb As New ADODB.Recordset
  234. Dim Mydb1 As New ADODB.Recordset
  235. Dim Man As New ADODB.Recordset
  236. Dim Count1 As New ADODB.Recordset
  237. Dim Str_text As String
  238. Private Sub cmd_add_Click()
  239.             On Error Resume Next
  240.             Dim A, B
  241.             
  242.             B = 1
  243.             Set Count1 = ExeCutesql("select key from 定期存款 ", Str_text)
  244.             Count1.MoveLast
  245.             B = Count1.Fields(0) + 1
  246.             A = MsgBox("是否添加前记录?", vbYesNo + 32, "修改记录")
  247.             If A = vbYes Then
  248.                ExeCutesql "insert into 定期存款 values('" & Format(DTPicker1.Value, "yyyy-mm-dd") & "','" & txt_name.Text _
  249.                & "','" & txt_address.Text & "','" & txt_size.Text & "'," & txt_money.Text & ",'" & txt_time.Text & "','" & Combo1.Text & "','" & Check1.Value & "'," & B & ")", Str_text
  250.                Call Bangding
  251.             End If
  252. End Sub
  253. Private Sub cmd_del_Click()
  254.             On Error Resume Next
  255.             Dim A
  256.             
  257.             A = MsgBox("是否删除当前记录?", vbYesNo + 32 + 256, "添加记录")
  258.             If A = vbYes Then
  259.                ExeCutesql "DELETE from 定期存款 where key=" & txt_key.Text & "", Str_text
  260.                Call Bangding
  261.             End If
  262. End Sub
  263. Private Sub cmd_edit_Click()
  264.             On Error Resume Next
  265.             Dim A
  266.             
  267.             A = MsgBox("是否修改前记录?", vbYesNo + 32, "添加记录")
  268.             If A = vbYes Then
  269.                ExeCutesql "Update 定期存款  Set 日期 = '" & DTPicker1.Value & "',银行名称='" & txt_name.Text _
  270.                & "',银行地址=" & txt_address.Text & ", 银行账号='" & txt_size.Text & "',金额='" & txt_money.Text _
  271.                & "',期限='" & txt_time.Text & "',存款人='" & Combo1.Text & "',取否='" & Check1.Value & "' Where key = " & txt_key.Text & "  ", Str_text
  272.                'Mydb.Requery
  273.                Call Bangding
  274.                MsgBox "数据修改成功!", vbOKOnly + 64, "成功"
  275.             End If
  276. End Sub
  277. Private Sub cmd_quit_Click()
  278.             Unload Me
  279. End Sub
  280. Private Sub Form_Load()
  281.             Dim A As Integer
  282.             DTPicker1.Value = Date
  283.             Call Bangding
  284.        
  285.             Set Mydb1 = ExeCutesql("select 姓名 from  成员 ", Str_text)
  286.             A = Mydb1.RecordCount
  287.             Set Combo1.DataSource = Mydb1
  288.             For I = 1 To A
  289.                 Combo1.AddItem Mydb1.Fields(0)
  290.                 Mydb1.MoveNext
  291.                 If Mydb1.EOF Then Exit For
  292.             Next I
  293. End Sub
  294. Private Function Bangding()
  295.                  Set Mydb = ExeCutesql("select * from 定期存款 ", Str_text)
  296.                  Set MSHFlexGrid1.DataSource = Mydb
  297. End Function
  298. Private Sub MSHFlexGrid1_Click()
  299.             On Error Resume Next
  300.             DTPicker1.Value = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 1)
  301.             txt_name.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 2)
  302.             txt_address.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 3)
  303.             txt_size.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 4)
  304.             txt_money.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 5)
  305.             txt_time.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 6)
  306.             Combo1.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 7)
  307.             Check1.Value = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 8)
  308.             txt_key.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 9)
  309.             
  310.             
  311. End Sub