home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / Bank / Bank.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-06-23  |  29.1 KB  |  891 lines

  1. VERSION 5.00
  2. Begin VB.Form frmBank 
  3.    Caption         =   "Teller"
  4.    ClientHeight    =   7665
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   7350
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   7665
  10.    ScaleWidth      =   7350
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Frame Frame6 
  13.       Height          =   735
  14.       Left            =   120
  15.       TabIndex        =   45
  16.       Top             =   6720
  17.       Width           =   7095
  18.       Begin VB.CommandButton cmdGetNetWorth 
  19.          Caption         =   "Get Net Worth"
  20.          Height          =   330
  21.          Left            =   210
  22.          TabIndex        =   25
  23.          Top             =   240
  24.          Width           =   1485
  25.       End
  26.       Begin VB.Label txtNetWorth 
  27.          BackColor       =   &H8000000B&
  28.          BorderStyle     =   1  'Fixed Single
  29.          BeginProperty Font 
  30.             Name            =   "MS Sans Serif"
  31.             Size            =   9.75
  32.             Charset         =   0
  33.             Weight          =   400
  34.             Underline       =   0   'False
  35.             Italic          =   0   'False
  36.             Strikethrough   =   0   'False
  37.          EndProperty
  38.          Height          =   375
  39.          Left            =   1920
  40.          TabIndex        =   50
  41.          Top             =   240
  42.          Width           =   1575
  43.       End
  44.    End
  45.    Begin VB.Frame Frame4 
  46.       Caption         =   "Savings"
  47.       BeginProperty Font 
  48.          Name            =   "MS Sans Serif"
  49.          Size            =   9.75
  50.          Charset         =   0
  51.          Weight          =   700
  52.          Underline       =   0   'False
  53.          Italic          =   0   'False
  54.          Strikethrough   =   0   'False
  55.       EndProperty
  56.       ForeColor       =   &H00800080&
  57.       Height          =   1935
  58.       Left            =   3720
  59.       TabIndex        =   35
  60.       Top             =   2400
  61.       Width           =   3495
  62.       Begin VB.CommandButton cmdSavDeposit 
  63.          Caption         =   "Deposit"
  64.          Height          =   360
  65.          Left            =   240
  66.          TabIndex        =   14
  67.          Top             =   840
  68.          Width           =   1215
  69.       End
  70.       Begin VB.CommandButton cmdSavWithdraw 
  71.          Caption         =   "Withdraw"
  72.          Height          =   360
  73.          Left            =   240
  74.          TabIndex        =   16
  75.          Top             =   1320
  76.          Width           =   1215
  77.       End
  78.       Begin VB.TextBox txtSavWithdraw 
  79.          Height          =   360
  80.          Left            =   1680
  81.          TabIndex        =   17
  82.          Top             =   1320
  83.          Width           =   1575
  84.       End
  85.       Begin VB.TextBox txtSavDeposit 
  86.          Height          =   360
  87.          Left            =   1680
  88.          TabIndex        =   15
  89.          Top             =   840
  90.          Width           =   1575
  91.       End
  92.       Begin VB.Label txtSavBalance 
  93.          BackColor       =   &H8000000B&
  94.          BorderStyle     =   1  'Fixed Single
  95.          BeginProperty Font 
  96.             Name            =   "MS Sans Serif"
  97.             Size            =   9.75
  98.             Charset         =   0
  99.             Weight          =   400
  100.             Underline       =   0   'False
  101.             Italic          =   0   'False
  102.             Strikethrough   =   0   'False
  103.          EndProperty
  104.          Height          =   375
  105.          Left            =   1680
  106.          TabIndex        =   47
  107.          Top             =   360
  108.          Width           =   1575
  109.       End
  110.       Begin VB.Label Label7 
  111.          Caption         =   "Balance"
  112.          BeginProperty Font 
  113.             Name            =   "MS Sans Serif"
  114.             Size            =   12
  115.             Charset         =   0
  116.             Weight          =   400
  117.             Underline       =   0   'False
  118.             Italic          =   0   'False
  119.             Strikethrough   =   0   'False
  120.          EndProperty
  121.          ForeColor       =   &H00C00000&
  122.          Height          =   255
  123.          Left            =   240
  124.          TabIndex        =   37
  125.          Top             =   360
  126.          Width           =   1215
  127.       End
  128.    End
  129.    Begin VB.Frame Frame1 
  130.       Caption         =   "Checking"
  131.       BeginProperty Font 
  132.          Name            =   "MS Sans Serif"
  133.          Size            =   9.75
  134.          Charset         =   0
  135.          Weight          =   700
  136.          Underline       =   0   'False
  137.          Italic          =   0   'False
  138.          Strikethrough   =   0   'False
  139.       EndProperty
  140.       ForeColor       =   &H00800080&
  141.       Height          =   1935
  142.       Left            =   120
  143.       TabIndex        =   34
  144.       Top             =   2400
  145.       Width           =   3495
  146.       Begin VB.CommandButton cmdChkDeposit 
  147.          Caption         =   "Deposit"
  148.          Height          =   360
  149.          Left            =   240
  150.          TabIndex        =   10
  151.          Top             =   840
  152.          Width           =   1215
  153.       End
  154.       Begin VB.CommandButton cmdChkWithdraw 
  155.          Caption         =   "Withdraw"
  156.          Height          =   360
  157.          Left            =   240
  158.          TabIndex        =   12
  159.          Top             =   1320
  160.          Width           =   1215
  161.       End
  162.       Begin VB.TextBox txtChkWithdraw 
  163.          Height          =   360
  164.          Left            =   1680
  165.          TabIndex        =   13
  166.          Top             =   1320
  167.          Width           =   1575
  168.       End
  169.       Begin VB.TextBox txtChkDeposit 
  170.          Height          =   360
  171.          Left            =   1680
  172.          TabIndex        =   11
  173.          Top             =   840
  174.          Width           =   1575
  175.       End
  176.       Begin VB.Label txtChkBalance 
  177.          BackColor       =   &H8000000B&
  178.          BorderStyle     =   1  'Fixed Single
  179.          BeginProperty Font 
  180.             Name            =   "MS Sans Serif"
  181.             Size            =   9.75
  182.             Charset         =   0
  183.             Weight          =   400
  184.             Underline       =   0   'False
  185.             Italic          =   0   'False
  186.             Strikethrough   =   0   'False
  187.          EndProperty
  188.          Height          =   375
  189.          Left            =   1680
  190.          TabIndex        =   48
  191.          Top             =   360
  192.          Width           =   1575
  193.       End
  194.       Begin VB.Label Label6 
  195.          Caption         =   "Balance"
  196.          BeginProperty Font 
  197.             Name            =   "MS Sans Serif"
  198.             Size            =   12
  199.             Charset         =   0
  200.             Weight          =   400
  201.             Underline       =   0   'False
  202.             Italic          =   0   'False
  203.             Strikethrough   =   0   'False
  204.          EndProperty
  205.          ForeColor       =   &H00C00000&
  206.          Height          =   255
  207.          Left            =   240
  208.          TabIndex        =   36
  209.          Top             =   360
  210.          Width           =   1215
  211.       End
  212.    End
  213.    Begin VB.Frame Frame3 
  214.       Caption         =   "Loan Details"
  215.       BeginProperty Font 
  216.          Name            =   "MS Sans Serif"
  217.          Size            =   9.75
  218.          Charset         =   0
  219.          Weight          =   700
  220.          Underline       =   0   'False
  221.          Italic          =   0   'False
  222.          Strikethrough   =   0   'False
  223.       EndProperty
  224.       ForeColor       =   &H00800080&
  225.       Height          =   2220
  226.       Left            =   120
  227.       TabIndex        =   30
  228.       Top             =   4440
  229.       Width           =   7065
  230.       Begin VB.TextBox txtRate 
  231.          Height          =   330
  232.          Left            =   1920
  233.          TabIndex        =   20
  234.          Top             =   1200
  235.          Width           =   1005
  236.       End
  237.       Begin VB.Frame Frame5 
  238.          Height          =   1815
  239.          Left            =   3360
  240.          TabIndex        =   38
  241.          Top             =   240
  242.          Width           =   3495
  243.          Begin VB.TextBox txtPmtAmt 
  244.             Height          =   380
  245.             Left            =   1800
  246.             TabIndex        =   24
  247.             Top             =   720
  248.             Width           =   1440
  249.          End
  250.          Begin VB.CommandButton cmdPmtFrmChk 
  251.             Caption         =   "From Checking"
  252.             Height          =   360
  253.             Left            =   240
  254.             TabIndex        =   23
  255.             Top             =   720
  256.             Width           =   1455
  257.          End
  258.          Begin VB.CommandButton cmdOpenAcct 
  259.             Caption         =   "Open Loan"
  260.             Height          =   405
  261.             Left            =   240
  262.             TabIndex        =   22
  263.             Top             =   240
  264.             Width           =   3015
  265.          End
  266.          Begin VB.Label txtLoanbalance 
  267.             BackColor       =   &H8000000B&
  268.             BorderStyle     =   1  'Fixed Single
  269.             BeginProperty Font 
  270.                Name            =   "MS Sans Serif"
  271.                Size            =   9.75
  272.                Charset         =   0
  273.                Weight          =   400
  274.                Underline       =   0   'False
  275.                Italic          =   0   'False
  276.                Strikethrough   =   0   'False
  277.             EndProperty
  278.             Height          =   375
  279.             Left            =   1800
  280.             TabIndex        =   49
  281.             Top             =   1320
  282.             Width           =   1455
  283.          End
  284.          Begin VB.Label Label14 
  285.             Caption         =   "Balance"
  286.             BeginProperty Font 
  287.                Name            =   "MS Sans Serif"
  288.                Size            =   12
  289.                Charset         =   0
  290.                Weight          =   400
  291.                Underline       =   0   'False
  292.                Italic          =   0   'False
  293.                Strikethrough   =   0   'False
  294.             EndProperty
  295.             ForeColor       =   &H00C00000&
  296.             Height          =   255
  297.             Left            =   360
  298.             TabIndex        =   46
  299.             Top             =   1320
  300.             Width           =   1215
  301.          End
  302.       End
  303.       Begin VB.TextBox txtTerm 
  304.          Height          =   330
  305.          Left            =   1920
  306.          TabIndex        =   19
  307.          Top             =   810
  308.          Width           =   1005
  309.       End
  310.       Begin VB.TextBox txtPrin 
  311.          Height          =   330
  312.          Left            =   1920
  313.          TabIndex        =   18
  314.          Top             =   420
  315.          Width           =   1005
  316.       End
  317.       Begin VB.CommandButton cmdCalcPmt 
  318.          Caption         =   "Calculate Payment"
  319.          Height          =   330
  320.          Left            =   210
  321.          TabIndex        =   21
  322.          Top             =   1680
  323.          Width           =   1485
  324.       End
  325.       Begin VB.PictureBox UpDown3 
  326.          Height          =   330
  327.          Left            =   3000
  328.          ScaleHeight     =   270
  329.          ScaleWidth      =   135
  330.          TabIndex        =   27
  331.          TabStop         =   0   'False
  332.          Top             =   810
  333.          Width           =   195
  334.       End
  335.       Begin VB.PictureBox UpDown2 
  336.          Height          =   330
  337.          Left            =   3000
  338.          ScaleHeight     =   270
  339.          ScaleWidth      =   135
  340.          TabIndex        =   26
  341.          TabStop         =   0   'False
  342.          Top             =   420
  343.          Width           =   195
  344.       End
  345.       Begin VB.PictureBox UpDown1 
  346.          Height          =   330
  347.          Left            =   3000
  348.          ScaleHeight     =   270
  349.          ScaleWidth      =   135
  350.          TabIndex        =   52
  351.          TabStop         =   0   'False
  352.          Top             =   1200
  353.          Width           =   195
  354.       End
  355.       Begin VB.Label txtPmt 
  356.          BackColor       =   &H8000000B&
  357.          BorderStyle     =   1  'Fixed Single
  358.          BeginProperty Font 
  359.             Name            =   "MS Sans Serif"
  360.             Size            =   9.75
  361.             Charset         =   0
  362.             Weight          =   400
  363.             Underline       =   0   'False
  364.             Italic          =   0   'False
  365.             Strikethrough   =   0   'False
  366.          EndProperty
  367.          Height          =   375
  368.          Left            =   1890
  369.          TabIndex        =   51
  370.          Top             =   1680
  371.          Width           =   1095
  372.       End
  373.       Begin VB.Label Label5 
  374.          Caption         =   "Term:"
  375.          BeginProperty Font 
  376.             Name            =   "MS Sans Serif"
  377.             Size            =   12
  378.             Charset         =   0
  379.             Weight          =   400
  380.             Underline       =   0   'False
  381.             Italic          =   0   'False
  382.             Strikethrough   =   0   'False
  383.          EndProperty
  384.          ForeColor       =   &H00C00000&
  385.          Height          =   330
  386.          Left            =   210
  387.          TabIndex        =   33
  388.          Top             =   810
  389.          Width           =   1065
  390.       End
  391.       Begin VB.Label Label3 
  392.          Caption         =   "Rate:"
  393.          BeginProperty Font 
  394.             Name            =   "MS Sans Serif"
  395.             Size            =   12
  396.             Charset         =   0
  397.             Weight          =   400
  398.             Underline       =   0   'False
  399.             Italic          =   0   'False
  400.             Strikethrough   =   0   'False
  401.          EndProperty
  402.          ForeColor       =   &H00C00000&
  403.          Height          =   330
  404.          Left            =   210
  405.          TabIndex        =   32
  406.          Top             =   1200
  407.          Width           =   1065
  408.       End
  409.       Begin VB.Label Label2 
  410.          Caption         =   "Principal:"
  411.          BeginProperty Font 
  412.             Name            =   "MS Sans Serif"
  413.             Size            =   12
  414.             Charset         =   0
  415.             Weight          =   400
  416.             Underline       =   0   'False
  417.             Italic          =   0   'False
  418.             Strikethrough   =   0   'False
  419.          EndProperty
  420.          ForeColor       =   &H00C00000&
  421.          Height          =   330
  422.          Left            =   210
  423.          TabIndex        =   31
  424.          Top             =   420
  425.          Width           =   1275
  426.       End
  427.    End
  428.    Begin VB.Frame Frame2 
  429.       Caption         =   "Customer Account"
  430.       BeginProperty Font 
  431.          Name            =   "MS Sans Serif"
  432.          Size            =   9.75
  433.          Charset         =   0
  434.          Weight          =   700
  435.          Underline       =   0   'False
  436.          Italic          =   0   'False
  437.          Strikethrough   =   0   'False
  438.       EndProperty
  439.       ForeColor       =   &H00800080&
  440.       Height          =   2160
  441.       Left            =   120
  442.       TabIndex        =   28
  443.       Top             =   120
  444.       Width           =   7095
  445.       Begin VB.CommandButton cmdclear 
  446.          Caption         =   "Clear"
  447.          Height          =   315
  448.          Left            =   5040
  449.          TabIndex        =   3
  450.          Top             =   360
  451.          Width           =   1080
  452.       End
  453.       Begin VB.TextBox txtCustLast 
  454.          Height          =   285
  455.          Left            =   3960
  456.          TabIndex        =   5
  457.          Top             =   960
  458.          Width           =   2055
  459.       End
  460.       Begin VB.TextBox txtCustZip 
  461.          Height          =   285
  462.          Left            =   4560
  463.          TabIndex        =   9
  464.          Top             =   1680
  465.          Width           =   1455
  466.       End
  467.       Begin VB.TextBox txtCustState 
  468.          Height          =   285
  469.          Left            =   3600
  470.          TabIndex        =   8
  471.          Top             =   1680
  472.          Width           =   495
  473.       End
  474.       Begin VB.TextBox txtCustCity 
  475.          Height          =   285
  476.          Left            =   1200
  477.          TabIndex        =   7
  478.          Top             =   1680
  479.          Width           =   1695
  480.       End
  481.       Begin VB.TextBox txtCustAddress 
  482.          Height          =   285
  483.          Left            =   1200
  484.          TabIndex        =   6
  485.          Top             =   1320
  486.          Width           =   4815
  487.       End
  488.       Begin VB.TextBox txtCustFirst 
  489.          Height          =   285
  490.          Left            =   1200
  491.          TabIndex        =   4
  492.          Top             =   960
  493.          Width           =   2055
  494.       End
  495.       Begin VB.CommandButton cmdSave 
  496.          Caption         =   "Save"
  497.          Height          =   315
  498.          Left            =   3840
  499.          TabIndex        =   2
  500.          Top             =   360
  501.          Width           =   1080
  502.       End
  503.       Begin VB.TextBox txtCustId 
  504.          Height          =   315
  505.          Left            =   1200
  506.          TabIndex        =   0
  507.          Text            =   "1234"
  508.          Top             =   360
  509.          Width           =   840
  510.       End
  511.       Begin VB.CommandButton cmdLoad 
  512.          Caption         =   "Load"
  513.          Height          =   315
  514.          Left            =   2640
  515.          TabIndex        =   1
  516.          Top             =   360
  517.          Width           =   1080
  518.       End
  519.       Begin VB.Label Label13 
  520.          Caption         =   "Last"
  521.          BeginProperty Font 
  522.             Name            =   "MS Sans Serif"
  523.             Size            =   9.75
  524.             Charset         =   0
  525.             Weight          =   400
  526.             Underline       =   0   'False
  527.             Italic          =   0   'False
  528.             Strikethrough   =   0   'False
  529.          EndProperty
  530.          ForeColor       =   &H00C00000&
  531.          Height          =   255
  532.          Left            =   3360
  533.          TabIndex        =   44
  534.          Top             =   960
  535.          Width           =   495
  536.       End
  537.       Begin VB.Label Label12 
  538.          Caption         =   "City"
  539.          BeginProperty Font 
  540.             Name            =   "MS Sans Serif"
  541.             Size            =   9.75
  542.             Charset         =   0
  543.             Weight          =   400
  544.             Underline       =   0   'False
  545.             Italic          =   0   'False
  546.             Strikethrough   =   0   'False
  547.          EndProperty
  548.          ForeColor       =   &H00C00000&
  549.          Height          =   255
  550.          Left            =   240
  551.          TabIndex        =   43
  552.          Top             =   1680
  553.          Width           =   495
  554.       End
  555.       Begin VB.Label Label11 
  556.          Caption         =   "State"
  557.          BeginProperty Font 
  558.             Name            =   "MS Sans Serif"
  559.             Size            =   9.75
  560.             Charset         =   0
  561.             Weight          =   400
  562.             Underline       =   0   'False
  563.             Italic          =   0   'False
  564.             Strikethrough   =   0   'False
  565.          EndProperty
  566.          ForeColor       =   &H00C00000&
  567.          Height          =   255
  568.          Left            =   3000
  569.          TabIndex        =   42
  570.          Top             =   1680
  571.          Width           =   735
  572.       End
  573.       Begin VB.Label Label10 
  574.          Caption         =   "Zip"
  575.          BeginProperty Font 
  576.             Name            =   "MS Sans Serif"
  577.             Size            =   9.75
  578.             Charset         =   0
  579.             Weight          =   400
  580.             Underline       =   0   'False
  581.             Italic          =   0   'False
  582.             Strikethrough   =   0   'False
  583.          EndProperty
  584.          ForeColor       =   &H00C00000&
  585.          Height          =   255
  586.          Left            =   4200
  587.          TabIndex        =   41
  588.          Top             =   1680
  589.          Width           =   615
  590.       End
  591.       Begin VB.Label Label9 
  592.          Caption         =   "Address"
  593.          BeginProperty Font 
  594.             Name            =   "MS Sans Serif"
  595.             Size            =   9.75
  596.             Charset         =   0
  597.             Weight          =   400
  598.             Underline       =   0   'False
  599.             Italic          =   0   'False
  600.             Strikethrough   =   0   'False
  601.          EndProperty
  602.          ForeColor       =   &H00C00000&
  603.          Height          =   255
  604.          Left            =   240
  605.          TabIndex        =   40
  606.          Top             =   1320
  607.          Width           =   975
  608.       End
  609.       Begin VB.Label Label8 
  610.          Caption         =   "First"
  611.          BeginProperty Font 
  612.             Name            =   "MS Sans Serif"
  613.             Size            =   9.75
  614.             Charset         =   0
  615.             Weight          =   400
  616.             Underline       =   0   'False
  617.             Italic          =   0   'False
  618.             Strikethrough   =   0   'False
  619.          EndProperty
  620.          ForeColor       =   &H00C00000&
  621.          Height          =   255
  622.          Left            =   240
  623.          TabIndex        =   39
  624.          Top             =   960
  625.          Width           =   975
  626.       End
  627.       Begin VB.Label Label1 
  628.          Caption         =   "Cust ID:"
  629.          BeginProperty Font 
  630.             Name            =   "MS Sans Serif"
  631.             Size            =   9.75
  632.             Charset         =   0
  633.             Weight          =   400
  634.             Underline       =   0   'False
  635.             Italic          =   0   'False
  636.             Strikethrough   =   0   'False
  637.          EndProperty
  638.          ForeColor       =   &H00C00000&
  639.          Height          =   255
  640.          Left            =   240
  641.          TabIndex        =   29
  642.          Top             =   360
  643.          Width           =   975
  644.       End
  645.    End
  646. Attribute VB_Name = "frmBank"
  647. Attribute VB_GlobalNameSpace = False
  648. Attribute VB_Creatable = False
  649. Attribute VB_PredeclaredId = True
  650. Attribute VB_Exposed = False
  651. '===========================================================================
  652. '  File:     Bank.cls
  653. '  Summary:   This is the form that implements the bank
  654. '----------------------------------------------------------------------------
  655. '  This file is part of the Microsoft NGWS Samples.
  656. '  Copyright (C) 1998-1999 Microsoft Corporation.  All rights reserved.
  657. '============================================================================
  658. Dim Cust As Customer.Customer
  659. Dim ChkAcct As Account.Account
  660. Dim SavAcct As Account.Account
  661. Dim Loan As Loan.BankLoan
  662. Const NoPermission = "Insufficient Funds"
  663. Private Sub Form_Load()
  664.     Set Cust = New Customer.Customer
  665.     Set ChkAcct = Cust.GetChkAcct
  666.     Set SavAcct = Cust.GetSavAcct
  667.     Set Loan = Cust.GetLoan
  668.     RefreshForm
  669.     txtCustId = "1234"
  670. End Sub
  671. Private Sub cmdLoad_Click()
  672.     If Len(txtCustId) > 0 Then
  673.         
  674.         If (Cust.Load(txtCustId)) Then
  675.             RefreshForm
  676.         Else
  677.             MsgBox ("could not load customer")
  678.         End If
  679.     Else
  680.         MsgBox "Customer Id required"
  681.     End If
  682. End Sub
  683. Private Sub cmdSave_Click()
  684.     Cust.SetId (txtCustId)
  685.     Cust.SetFirst (txtCustFirst)
  686.     Cust.SetLast (txtCustLast)
  687.     Cust.SetAddress (txtCustAddress)
  688.     Cust.SetCity (txtCustCity)
  689.     Cust.SetState (txtCustState)
  690.     Cust.SetZip (txtCustZip)
  691.     If (Cust.Save) Then
  692.         
  693.     Else
  694.         MsgBox ("unable to save customer")
  695.     End If
  696.         
  697. End Sub
  698. Private Sub cmdclear_Click()
  699.     Cust.SetFirst ("")
  700.     Cust.SetLast ("")
  701.     Cust.SetAddress ("")
  702.     Cust.SetCity ("")
  703.     Cust.SetState ("")
  704.     Cust.SetZip ("")
  705.     ChkAcct.SetBalance (0)
  706.     SavAcct.SetBalance (0)
  707.     Loan.SetBalance (0)
  708.     Loan.SetPrincipal (0)
  709.     Loan.SetRate (0)
  710.     Loan.SetTerm (0)
  711.     Loan.SetPayment (0)
  712.     RefreshForm
  713. End Sub
  714. Private Sub cmdChkDeposit_Click()
  715.     If (Val(txtChkDeposit) > 0) Then
  716.         If (ChkAcct.Credit(txtChkDeposit) = 0) Then
  717.             MsgBox (NoPermission)
  718.         End If
  719.         txtChkBalance = Format(ChkAcct.GetBalance, "#,##0.00")
  720.     Else
  721.         MsgBox ("Invalid input")
  722.     End If
  723. End Sub
  724. Private Sub cmdChkWithdraw_Click()
  725.     If (Val(txtChkWithdraw) > 0) Then
  726.         If (ChkAcct.Debit(txtChkWithdraw) = 0) Then
  727.             MsgBox (NoPermission)
  728.         End If
  729.     Else
  730.         MsgBox ("Invalid input")
  731.     End If
  732.        
  733.        txtChkBalance = Format(ChkAcct.GetBalance, "#,##0.00")
  734.        
  735. End Sub
  736. Private Sub cmdSavDeposit_Click()
  737.     If (Val(txtSavDeposit) > 0) Then
  738.         If (SavAcct.Credit(txtSavDeposit) = 0) Then
  739.        
  740.            MsgBox (NoPermission)
  741.            
  742.       End If
  743.        
  744.         txtSavBalance = Format(SavAcct.GetBalance, "#,##0.00")
  745.     Else
  746.         MsgBox ("Invalid Input")
  747.     End If
  748. End Sub
  749. Private Sub cmdSavWithdraw_Click()
  750.     If (Val(txtSavWithdraw) > 0) Then
  751.         If (SavAcct.Debit(txtSavWithdraw) = 0) Then
  752.             MsgBox (NoPermission)
  753.             End If
  754.         txtSavBalance = Format(SavAcct.GetBalance, "#,##0.00")
  755.     Else
  756.         MsgBox ("Invalid Input")
  757.     End If
  758. End Sub
  759. Private Sub cmdCalcPmt_Click()
  760.     Dim Pmt
  761.     If Val(txtPrin) = 0 Then
  762.         MsgBox ("Please enter a valid number for Principle")
  763.         txtPrin.SetFocus
  764.     ElseIf Val(txtRate) = 0 Then
  765.         MsgBox ("Please enter valid valid number for Rate (percent)")
  766.         txtRate.SetFocus
  767.     ElseIf Val(txtTerm) = 0 Then
  768.         MsgBox ("Please enter valid input for valid length for Term (months)")
  769.         txtTerm.SetFocus
  770.     Else
  771.         Pmt = Loan.CalcPmt(txtPrin, txtRate / 1200, txtTerm)
  772.     End If
  773.     txtPmt = Format(Pmt, "#,##0.00")
  774. End Sub
  775. Private Sub cmdOpenAcct_Click()
  776.     If (txtPrin = 0# Or txtRate = 0# Or txtTerm = 0) Then
  777.         MsgBox ("Please enter valid input")
  778.     ElseIf (Loan.OpenAccount(txtPrin, txtRate / 1200, txtTerm)) Then
  779.         balance = Loan.GetBalance
  780.         Payment = Loan.GetPayment
  781.         
  782.         txtLoanbalance = Format(balance, "#,##0.00")
  783.         txtPmtAmt = Format(Payment, "#,##0.00")
  784.         txtPmt = txtPmtAmt
  785.     Else
  786.         MsgBox (NoPermission)
  787.     End If
  788. End Sub
  789. Private Sub cmdPmtFrmChk_Click()
  790.     PmtAmt = txtPmtAmt
  791.     If (Round(Loan.GetBalance, 2) < Round(PmtAmt, 2)) Then
  792.         MsgBox "Payment more than Loan balance!!!"
  793.         txtPmtAmt = Round(Loan.GetBalance, 2)
  794.         Exit Sub
  795.     End If
  796.     If (ChkAcct.GetBalance() >= PmtAmt) Then
  797.         If (ChkAcct.Debit(PmtAmt) = 0) Then
  798.             MsgBox (NoPermission)
  799.         Else
  800.             Loan.MakePayment (PmtAmt)
  801.             txtLoanbalance = Format(Loan.GetBalance, "#,##0.00")
  802.             txtChkBalance = Format(ChkAcct.GetBalance, "#,##0.00")
  803.         End If
  804.     Else
  805.         MsgBox ("Insufficient funds in checking")
  806.     End If
  807. End Sub
  808. Private Sub cmdGetNetWorth_Click()
  809.     txtNetWorth = Format(Cust.GetNetWorth, "#,###,##0.00")
  810. End Sub
  811. Private Sub RefreshForm()
  812.     txtCustId = Cust.GetId
  813.     txtCustFirst = Cust.GetFirst
  814.     txtCustLast = Cust.GetLast
  815.     txtCustAddress = Cust.GetAddress
  816.     txtCustCity = Cust.GetCity
  817.     txtCustState = Cust.GetState
  818.     txtCustZip = Cust.GetZip
  819.     txtChkBalance = Format(ChkAcct.GetBalance, "#,##0.00")
  820.     txtSavBalance = Format(SavAcct.GetBalance, "#,##0.00")
  821.     txtLoanbalance = Format(Loan.GetBalance, "#,##0.00")
  822.      
  823.     txtPrin = Format(Loan.GetPrincipal, "#,##0.00")
  824.     txtRate = Format(Loan.GetRate * 1200, "#,##0.00")
  825.     txtTerm = Format(Loan.GetTerm, "##0")
  826.     txtPmt = Format(Loan.GetPayment, "#,##0.00")
  827.     txtNetWorth = Format(Cust.GetNetWorth, "#,##0.00")
  828.     txtChkDeposit = ""
  829.     txtSavDeposit = ""
  830.     txtChkWithdraw = ""
  831.     txtSavWithdraw = ""
  832.     txtPmtAmt = txtPmt
  833. End Sub
  834. Private Sub txtChkDeposit_KeyPress(KeyAscii As Integer)
  835.     Validate_Decimal KeyAscii
  836. End Sub
  837. Private Sub txtChkWithdraw_KeyPress(KeyAscii As Integer)
  838.     Validate_Decimal KeyAscii
  839. End Sub
  840. Private Sub txtPmtAmt_KeyPress(KeyAscii As Integer)
  841.     Validate_Decimal KeyAscii
  842. End Sub
  843. Private Sub txtPrin_Change()
  844.     SetLoanRate
  845. End Sub
  846. Private Sub txtPrin_KeyPress(KeyAscii As Integer)
  847.     Validate_Decimal KeyAscii
  848. End Sub
  849. Private Sub txtRate_KeyPress(KeyAscii As Integer)
  850.     Validate_Decimal KeyAscii
  851. End Sub
  852. Private Sub txtSavDeposit_KeyPress(KeyAscii As Integer)
  853.     Validate_Decimal KeyAscii
  854. End Sub
  855. Private Sub txtSavWithdraw_KeyPress(KeyAscii As Integer)
  856.     Validate_Decimal KeyAscii
  857. End Sub
  858. Private Sub txtTerm_Change()
  859.     SetLoanRate
  860. End Sub
  861. Sub SetLoanRate()
  862.     'On Error Resume Next
  863.     If Val(txtPrin) > 0 And Val(txtTerm) > 0 And Val(txtTerm) <= 360 Then
  864.         Dim MinRate
  865.         
  866.         MinRate = Cust.GetMinLoanRate(txtPrin, txtTerm)
  867.         If MinRate > 0 Then txtRate = Format(MinRate, "##.00")
  868.     End If
  869. End Sub
  870. Private Sub txtTerm_KeyPress(KeyAscii As Integer)
  871.     Validate_Decimal KeyAscii
  872. End Sub
  873. Private Sub Validate_Decimal(ByRef KeyAscii As Integer)
  874.     valid_decimal = "01234567890.-" + Chr$(8)
  875.     If KeyAscii = 13 Then
  876.         KeyAscii = 0
  877.     ElseIf InStr(valid_decimal, Chr$(KeyAscii)) = 0 Then
  878.         Beep
  879.         KeyAscii = 0
  880.     End If
  881. End Sub
  882. Private Sub Validate_Integer(ByRef KeyAscii As Integer)
  883.     valid_integer = "01234567890-" + Chr$(8)
  884.     If KeyAscii = 13 Then
  885.         KeyAscii = 0
  886.     ElseIf InStr(valid_integer, Chr$(KeyAscii)) = 0 Then
  887.         Beep
  888.         KeyAscii = 0
  889.     End If
  890. End Sub
  891.