home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
- Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
- Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.Form frmMain
- Caption = "Mortgage Calculator"
- ClientHeight = 8595
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 11880
- LinkTopic = "Form1"
- ScaleHeight = 8595
- ScaleWidth = 11880
- StartUpPosition = 2 'CenterScreen
- WindowState = 2 'Maximized
- Begin VB.CommandButton cmdCopyChart
- Caption = "&Copy Chart"
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 1320
- TabIndex = 13
- Top = 3600
- Width = 1215
- End
- Begin MSComDlg.CommonDialog cdlExport
- Left = 3000
- Top = 2520
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin VB.CommandButton cmdToHTML
- Caption = "To &HTML"
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 720
- TabIndex = 11
- Top = 3020
- Width = 1215
- End
- Begin VB.Frame Frame1
- Caption = "Graph"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 975
- Left = 2640
- TabIndex = 20
- Top = 3120
- Visible = 0 'False
- Width = 1455
- Begin VB.OptionButton optGraph
- Caption = "Line"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 15
- Top = 600
- Width = 1215
- End
- Begin VB.OptionButton optGraph
- Caption = "Area"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 14
- Top = 300
- Width = 1215
- End
- End
- Begin MSChart20Lib.MSChart MSChart1
- Height = 3975
- Left = 4200
- OleObjectBlob = "frmMain.frx":0000
- TabIndex = 19
- Top = 120
- Visible = 0 'False
- Width = 7575
- End
- Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
- Height = 3975
- Left = 120
- TabIndex = 18
- Top = 4200
- Visible = 0 'False
- Width = 11775
- _ExtentX = 20770
- _ExtentY = 7011
- _Version = 393216
- Cols = 8
- FixedCols = 0
- AllowUserResizing= 1
- FormatString = ""
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Begin VB.CommandButton cmdChart
- Caption = "&View Chart"
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 120
- TabIndex = 12
- Top = 3600
- Width = 1215
- End
- Begin VB.CommandButton cmdAmortise
- Caption = "&Amortisation Table"
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 120
- TabIndex = 10
- Top = 2520
- Width = 2415
- End
- Begin VB.TextBox txtResult
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 2880
- TabIndex = 16
- Text = "0"
- Top = 1980
- Width = 1215
- End
- Begin VB.CommandButton cmdCalculate
- Caption = "&Monthly Payment"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 120
- TabIndex = 9
- Top = 1920
- Width = 2415
- End
- Begin MSComCtl2.DTPicker dtpStart
- Height = 375
- Left = 2520
- TabIndex = 8
- Top = 1500
- Width = 1575
- _ExtentX = 2778
- _ExtentY = 661
- _Version = 393216
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- CustomFormat = "dd/MM/yyy"
- Format = 24510467
- CurrentDate = 36908
- End
- Begin VB.TextBox txtTerm
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 2520
- TabIndex = 7
- Top = 1020
- Width = 735
- End
- Begin VB.TextBox txtInterest
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 2520
- TabIndex = 5
- Top = 540
- Width = 735
- End
- Begin VB.TextBox txtLoan
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 2520
- TabIndex = 4
- Top = 60
- Width = 1575
- End
- Begin VB.Label Label6
- AutoSize = -1 'True
- Caption = "="
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 2640
- TabIndex = 17
- Top = 2040
- Width = 135
- End
- Begin VB.Label Label5
- Caption = "%"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 3240
- TabIndex = 6
- Top = 600
- Width = 255
- End
- Begin VB.Label Label4
- Caption = "Date of First Payment:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 1560
- Width = 2295
- End
- Begin VB.Label Label3
- Caption = "Term (Whole Years):"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 2
- Top = 1080
- Width = 2295
- End
- Begin VB.Label Label2
- Caption = "Interest Rate:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 600
- Width = 2295
- End
- Begin VB.Label Label1
- Caption = "Loan Amount:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 2295
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private iPayments As Integer ' iPayments = no. of MONTHLY payments payable
- Private Sub cmdAmortise_Click()
- 'This sub populates the MSFlexgrid
- On Error Resume Next ' to compensate for the error sometimes given in the cell colour changing routine
- Dim sCurrMonth As String 'for the Date column
- Dim iDay, iMonth, iYear, iCountPay As Integer ' 1st 3 are for the date column, 4th is the loop counter
- Dim dCurrBal, dCurrInt, dCurrPrin, dEndBal, dCumInt, dTotPaid As Double 'Period's starting loan balance, interest this period,
- 'principal paid this period, loan balance at end of period,
- 'cumulative interest at end of period, total paid to date at end of period
- '; respectively!
- Dim sWhen As String 'the commencement date
- frmMain.MousePointer = vbHourglass ' cpu busy
- sWhen = dtpStart ' assign commencement date
- iDay = Val(Left(sWhen, 2)) ' the day
- iMonth = Val(Mid(sWhen, 4, 2)) ' the month
- iYear = Val(Right(sWhen, 2)) ' the year - latter 2 are required to increment period
- dTotPaid = txtResult.Text ' assign monthly payment
- dCurrBal = txtLoan.Text ' assign loan balance for 1st period
- dCurrInt = dCurrBal / 12 * (txtInterest / 100) ' assign interest for the first period
- dCurrPrin = dTotPaid - dCurrInt ' assign principal paid for the first period
- dEndBal = dCurrBal -= txtLoan.Te4rest9 eg loan ba e rst period
- dCurrPrin = dTght ' theXCurrPrin n
- Captnt date
- . e r Captnt date
- .t Ra|tn eguBal -= saieg
- C1theXCheXCheXCheXbAt9 n = d5nterest / 100) ' assiguaox 3t = 0 'Fa
- dCur
-