VERSION 5.00
Begin VB.Form frmInvestment 
   BackColor       =   &H80000002&
   Caption         =   "Investment Calculator ...."
   ClientHeight    =   6030
   ClientLeft      =   120
   ClientTop       =   420
   ClientWidth     =   8700
   LinkTopic       =   "Form1"
   ScaleHeight     =   6030
   ScaleWidth      =   8700
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtInitial 
      BackColor       =   &H8000000B&
      Height          =   360
      Left            =   4320
      TabIndex        =   19
      Top             =   5160
      Width           =   1455
   End
   Begin VB.TextBox txtNoinvestors 
      BackColor       =   &H8000000B&
      Height          =   360
      Left            =   600
      TabIndex        =   17
      Top             =   5160
      Width           =   1215
   End
   Begin VB.CommandButton cmdSummary 
      BackColor       =   &H00FF0000&
      Caption         =   "Club Summary"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   6720
      Style           =   1  'Graphical
      TabIndex        =   16
      Top             =   3600
      Width           =   1575
   End
   Begin VB.CommandButton cmdExit 
      BackColor       =   &H00FF0000&
      Caption         =   "Exit"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   6720
      Style           =   1  'Graphical
      TabIndex        =   15
      Top             =   4200
      Width           =   1575
   End
   Begin VB.CommandButton cmdNewinvester 
      BackColor       =   &H00FF0000&
      Caption         =   "New investor"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   6720
      Style           =   1  'Graphical
      TabIndex        =   14
      Top             =   3000
      Width           =   1575
   End
   Begin VB.CommandButton cmdClear 
      BackColor       =   &H00FF0000&
      Caption         =   "Clear"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   6720
      Style           =   1  'Graphical
      TabIndex        =   13
      Top             =   1800
      Width           =   1575
   End
   Begin VB.CommandButton cmdAddtoclub 
      BackColor       =   &H00FF0000&
      Caption         =   "Add to club"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   6720
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   2400
      Width           =   1575
   End
   Begin VB.CommandButton cmdportfolio 
      BackColor       =   &H00FF0000&
      Caption         =   "Add to portfolio"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   6720
      Style           =   1  'Graphical
      TabIndex        =   11
      Top             =   1200
      Width           =   1575
   End
   Begin VB.CommandButton cmdCalculate 
      BackColor       =   &H00FF0000&
      Caption         =   "Calculate"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      Left            =   6720
      MaskColor       =   &H00808080&
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   600
      Width           =   1575
   End
   Begin VB.TextBox txtInitialInvestment 
      BackColor       =   &H8000000B&
      Height          =   360
      Left            =   3000
      TabIndex        =   9
      Top             =   3720
      Width           =   1455
   End
   Begin VB.TextBox txtGrowthrate 
      BackColor       =   &H8000000B&
      Height          =   360
      Left            =   4320
      TabIndex        =   7
      Top             =   2280
      Width           =   1215
   End
   Begin VB.TextBox txtTermyears 
      BackColor       =   &H8000000B&
      Height          =   360
      Left            =   2520
      TabIndex        =   5
      Top             =   2280
      Width           =   1215
   End
   Begin VB.TextBox txtInvestmentgoal 
      BackColor       =   &H8000000B&
      Height          =   360
      Left            =   600
      TabIndex        =   3
      Top             =   2280
      Width           =   1215
   End
   Begin VB.TextBox txtName 
      BackColor       =   &H8000000B&
      Height          =   360
      Left            =   2400
      TabIndex        =   1
      Top             =   840
      Width           =   2415
   End
   Begin VB.Label lblInitial 
      BackColor       =   &H80000002&
      Caption         =   "Initial number of investments"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4440
      TabIndex        =   20
      Top             =   4440
      Width           =   1335
   End
   Begin VB.Label lblNoinvestors 
      BackColor       =   &H80000002&
      Caption         =   "Numbe of investors"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   600
      TabIndex        =   18
      Top             =   4440
      Width           =   1455
   End
   Begin VB.Line Line3 
      X1              =   8280
      X2              =   0
      Y1              =   4200
      Y2              =   4200
   End
   Begin VB.Line Line2 
      X1              =   0
      X2              =   9840
      Y1              =   2880
      Y2              =   2880
   End
   Begin VB.Line Line1 
      X1              =   120
      X2              =   9840
      Y1              =   1680
      Y2              =   1680
   End
   Begin VB.Label lblInitialinvestment 
      BackColor       =   &H80000002&
      Caption         =   "Initial Investment"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3000
      TabIndex        =   8
      Top             =   3240
      Width           =   1695
   End
   Begin VB.Label lblGrowthrate 
      BackColor       =   &H80000002&
      Caption         =   "Growth Rate %"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4320
      TabIndex        =   6
      Top             =   1800
      Width           =   1335
   End
   Begin VB.Label lblYears 
      BackColor       =   &H80000002&
      Caption         =   "Term in years"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2640
      TabIndex        =   4
      Top             =   1800
      Width           =   1215
   End
   Begin VB.Label lblInvestmentgoal 
      BackColor       =   &H80000002&
      Caption         =   "Investment Goal"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   2
      Top             =   1800
      Width           =   1455
   End
   Begin VB.Label lblName 
      BackColor       =   &H80000002&
      Caption         =   "Investor Name"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2880
      TabIndex        =   0
      Top             =   360
      Width           =   1455
   End
End
Attribute VB_Name = "frmInvestment"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public PV As Double
Public FV As Double
Public i As Double
Public n As Double
Public Initial As Double
Public Investments As Double
Public Investors As Integer

Private Sub cmdCalculate_Click()
txtInitialInvestment.Text = Val(txtInvestmentgoal.Text) / ((Val(((txtGrowthrate.Text) / 100) + 1) ^ txtTermyears.Text))

End Sub

Private Sub cmdClear_Click()
txtName.Text = ""
txtInvestmentgoal.Text = ""
txtTermyears.Text = ""
txtGrowthrate.Text = ""
txtInitialInvestment.Text = ""

txtName.SetFocus
End Sub

Private Sub cmdExit_Click()
Dim ans As Integer
ans = MsgBox("Are you sure you want to quit?", vbYesNo + vbQuestion, "quit")            'This is the message to be displayed once clicked on exit
If ans = vbYes Then                                                            'If answer is yes, then it will quit the program
    End                                                                     'If answer is no, then the program will still run
End If
End Sub

Private Sub cmdportfolio_Click()
Initial = Initial + PV
Investments = Investments + 1
txtNoinvestors.Text = Investments
txtInitial.Text = Format(Initial, "Currency")
cmdNewinvester.Visible = True
cmdAddtoclub.Visible = True
cmdportfolio.Visible = False
lblNoinvestors.Visible = True
txtNoinvestors.Visible = True
lblInitial.Visible = True
txtInitial.Visible = True
txtInvestmentgoal.Text = ""
txtGrowthrate.Text = ""
txtTermyears.Text = ""
txtInitialInvestment.Text = ""
txtInvestmentgoal.SetFocus

End Sub

Private Sub cmdSummary_Click()
' Purpose: When the Display Second Form button is clicked,
'          the second form becomes visible.
    frmSummary.Show
End Sub

' Purpose: When the Display Second Form button is clicked,
'          the second form becomes visible.
Private Sub cmdShowSummary_Click()
    frmSummary.Show
End Sub

' Purpose:  When the user closes this form, the second form is also
'           unloaded from memory, thus ending the application
Private Sub Form_Unload(Cancel As Integer)
    Unload frmSummary
End Sub
End Sub
