home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form frmCollege BackColor = &H00FF0000& BorderStyle = 1 'Fixed Single Caption = "College Goal # 1" Height = 4320 Icon = COLLEGE.FRX:0000 Left = 1335 LinkTopic = "Form1" MaxButton = 0 'False MDIChild = -1 'True ScaleHeight = 3690 ScaleWidth = 7215 Top = 495 Width = 7275 Begin TextBox txtColIntRate Height = 285 Left = 3150 MaxLength = 4 TabIndex = 7 Top = 2415 Width = 525 End Begin TextBox txtColSaved Height = 285 Left = 3150 MaxLength = 7 TabIndex = 6 Top = 2100 Width = 990 End Begin HScrollBar HsbColYears Height = 285 Left = 3540 Max = 10 Min = 1 TabIndex = 13 Top = 1800 Value = 4 Width = 1155 End Begin TextBox txtColYears Height = 285 Left = 3150 MaxLength = 2 TabIndex = 5 Text = "4" Top = 1800 Width = 375 End Begin TextBox txtColIncrease Height = 285 Left = 3150 MaxLength = 4 TabIndex = 4 Top = 1500 Width = 525 End Begin TextBox txtColAnnCost Height = 285 Left = 3150 MaxLength = 7 TabIndex = 3 Top = 1200 Width = 990 End Begin HScrollBar HsbColAge Height = 285 Left = 3555 Max = 50 Min = 1 TabIndex = 12 Top = 900 Value = 19 Width = 1155 End Begin TextBox txtColAge Height = 285 Left = 3150 MaxLength = 2 TabIndex = 2 Text = "19" Top = 900 Width = 375 End Begin HScrollBar HsbAge Height = 285 Left = 3555 Max = 50 Min = 1 TabIndex = 11 Top = 585 Value = 1 Width = 1155 End Begin TextBox txtAge Height = 285 Left = 3150 MaxLength = 2 TabIndex = 1 Text = "1" Top = 585 Width = 375 End Begin TextBox txtColName Height = 285 Left = 3150 MaxLength = 20 TabIndex = 0 Top = 270 Width = 1575 End Begin CommandButton CmdCalc Caption = "&Calc Results" Default = -1 'True Height = 405 Left = 1125 TabIndex = 8 Top = 2775 Width = 1335 End Begin CommandButton CmdGrid BackColor = &H00FFFFFF& Caption = "&Grid Results" Height = 405 Left = 2910 TabIndex = 9 Top = 2775 Width = 1335 End Begin CommandButton CmdGraph Caption = "G&raph Results" Height = 405 Left = 4620 TabIndex = 10 Top = 2775 Width = 1335 End Begin PictureBox Picture1 BackColor = &H00C0C0C0& Height = 465 Left = -15 ScaleHeight = 435 ScaleWidth = 7230 TabIndex = 14 Top = 3240 Width = 7260 Begin Line Line16 BorderColor = &H00FFFFFF& X1 = 7125 X2 = 7125 Y1 = 105 Y2 = 345 End Begin Line Line15 BorderColor = &H00FFFFFF& X1 = 5325 X2 = 7125 Y1 = 345 Y2 = 345 End Begin Line Line14 BorderColor = &H00808080& X1 = 5325 X2 = 7140 Y1 = 105 Y2 = 105 End Begin Line Line13 BorderColor = &H00808080& X1 = 5325 X2 = 5325 Y1 = 105 Y2 = 345 End Begin Line Line12 BorderColor = &H00FFFFFF& X1 = 3600 X2 = 4785 Y1 = 345 Y2 = 345 End Begin Line Line11 BorderColor = &H00FFFFFF& X1 = 4770 X2 = 4770 Y1 = 105 Y2 = 345 End Begin Line Line10 BorderColor = &H00808080& X1 = 3585 X2 = 4770 Y1 = 105 Y2 = 105 End Begin Line Line9 BorderColor = &H00808080& X1 = 3570 X2 = 3570 Y1 = 105 Y2 = 345 End Begin Line Line8 BorderColor = &H00FFFFFF& X1 = 1185 X2 = 2790 Y1 = 345 Y2 = 345 End Begin Line Line7 BorderColor = &H00FFFFFF& X1 = 2790 X2 = 2790 Y1 = 120 Y2 = 345 End Begin Line Line6 BorderColor = &H00808080& X1 = 1200 X2 = 2805 Y1 = 105 Y2 = 105 End Begin Line Line5 BorderColor = &H00808080& X1 = 1185 X2 = 1185 Y1 = 105 Y2 = 345 End Begin Label lblAmtMonthly BackColor = &H0000FFFF& BackStyle = 0 'Transparent Height = 195 Left = 3600 TabIndex = 20 Top = 135 Width = 1200 End Begin Label Label14 Alignment = 1 'Right Justify AutoSize = -1 'True BackColor = &H00808080& BackStyle = 0 'Transparent Caption = "Monthly:" ForeColor = &H00FF0000& Height = 195 Left = 2835 TabIndex = 19 Top = 135 Width = 735 End Begin Label LblColTotalCost BackColor = &H0000FFFF& BackStyle = 0 'Transparent Height = 200 Left = 5325 TabIndex = 18 Top = 135 Width = 1800 End Begin Label Label10 Alignment = 1 'Right Justify AutoSize = -1 'True BackColor = &H00808080& BackStyle = 0 'Transparent Caption = "Total:" ForeColor = &H00FF0000& Height = 195 Left = 4785 TabIndex = 17 Top = 135 Width = 540 End Begin Label LblAmtYearly BackColor = &H0000FFFF& BackStyle = 0 'Transparent Height = 200 Left = 1185 TabIndex = 16 Top = 135 Width = 1605 End Begin Label Label11 Alignment = 1 'Right Justify AutoSize = -1 'True BackColor = &H00808080& BackStyle = 0 'Transparent Caption = "Save Yearly:" ForeColor = &H00FF0000& Height = 195 Left = 90 TabIndex = 15 Top = 135 Width = 1095 End Begin Line Line1 BorderColor = &H00808080& X1 = 75 X2 = 7170 Y1 = 60 Y2 = 60 End Begin Line Line2 BorderColor = &H00808080& X1 = 60 X2 = 60 Y1 = 60 Y2 = 405 End Begin Line Line3 BorderColor = &H00FFFFFF& X1 = 60 X2 = 7170 Y1 = 390 Y2 = 390 End Begin Line Line4 BorderColor = &H00FFFFFF& X1 = 7170 X2 = 7170 Y1 = 60 Y2 = 390 End End Begin PictureBox Picture2 BackColor = &H00FF0000& BorderStyle = 0 'None FillColor = &H0000FFFF& ForeColor = &H0000FFFF& Height = 3375 Left = 5865 Picture = COLLEGE.FRX:0302 ScaleHeight = 3375 ScaleWidth = 1395 TabIndex = 21 Top = 15 Width = 1395 End Begin Label Label9 AutoSize = -1 'True BackColor = &H00FF0000& Caption = "College and Student Information" ForeColor = &H0000FFFF& Height = 195 Left = 3135 TabIndex = 32 Top = 15 Width = 2790 End Begin Label Label5 Alignment = 1 'Right Justify BackColor = &H0000FFFF& BackStyle = 0 'Transparent Caption = "Annual increase in cost of college:" ForeColor = &H0000FFFF& Height = 255 Left = 30 TabIndex = 31 Top = 1515 Width = 3015 End Begin Label Label4 Alignment = 1 'Right Justify BackStyle = 0 'Transparent Caption = "Current annual cost of college:" ForeColor = &H0000FFFF& Height = 255 Left = 390 TabIndex = 30 Top = 1215 Width = 2655 End Begin Label Label3 Alignment = 1 'Right Justify BackStyle = 0 'Transparent Caption = "College Age:" ForeColor = &H0000FFFF& Height = 255 Left = 1890 TabIndex = 29 Top = 915 Width = 1155 End Begin Label Label2 Alignment = 1 'Right Justify BackStyle = 0 'Transparent Caption = "Age:" ForeColor = &H0000FFFF& Height = 255 Left = 2610 TabIndex = 28 Top = 615 Width = 435 End Begin Label Label1 Alignment = 1 'Right Justify BackColor = &H00FFFFFF& BackStyle = 0 'Transparent Caption = "Student Name:" ForeColor = &H0000FFFF& Height = 255 Left = 1710 TabIndex = 27 Top = 315 Width = 1335 End Begin Label Label6 Alignment = 1 'Right Justify BackStyle = 0 'Transparent Caption = "Number of years in college:" ForeColor = &H0000FFFF& Height = 255 Left = 630 TabIndex = 26 Top = 1815 Width = 2415 End Begin Label Label7 Alignment = 1 'Right Justify BackStyle = 0 'Transparent Caption = "Amount saved for this student:" ForeColor = &H0000FFFF& Height = 255 Left = 30 TabIndex = 25 Top = 2130 Width = 3015 End Begin Label Label8 Alignment = 1 'Right Justify BackStyle = 0 'Transparent Caption = "Annual Rate of Return:" ForeColor = &H0000FFFF& Height = 255 Left = 870 TabIndex = 24 Top = 2415 Width = 2175 End Begin Label Label12 BackColor = &H00FF0000& Caption = "%" ForeColor = &H0000FFFF& Height = 195 Left = 3720 TabIndex = 23 Top = 1530 Width = 255 End Begin Label Label13 BackColor = &H00FF0000& Caption = "%" ForeColor = &H0000FFFF& Height = 195 Left = 3720 TabIndex = 22 Top = 2460 Width = 255 End Begin Menu mnuFile Caption = "&File" Begin Menu mnuNewCGoal Caption = "New &College Goal..." End Begin Menu mnuNewGGoal Caption = "New &General Goal..." End Begin Menu mnuDash Caption = "-" End Begin Menu mnuNewSPlan Caption = "&New Savings Plan" End Begin Menu mnuOpenSPlan Caption = "&Open Savings Plan..." End Begin Menu mnuSaveSPlan Caption = "&Save Savings Plan" End Begin Menu mnuSaveAsSPlan Caption = "Save Saving Plan &As..." End Begin Menu mnuDash2 Caption = "-" End Begin Menu mnuExit Caption = "E&xit" End End Begin Menu mnuGraph Caption = "Gr&aph" Begin Menu mnuSelGraph Caption = "&Selected Goal" End Begin Menu mnuComGraph Caption = "&Combined Goals" End End Begin Menu mnuGrid Caption = "Gr&id" Begin Menu mnuSelGrid Caption = "&Selected Goal" End Begin Menu mnuComGrid Caption = "&Combined Goals" End End Begin Menu mnuOpt Caption = "&Options" Begin Menu mnuToolbar Caption = "&Toolbar" Checked = -1 'True End End Begin Menu mnuWindow Caption = "&Window" WindowList = -1 'True Begin Menu mnuCascade Caption = "&Cascade" End Begin Menu mnuArrangeIcons Caption = "&Arrange Icons" End End Begin Menu mnuHelp Caption = "&Help" Begin Menu mnuHelpInstructions Caption = "&Instructions" End Begin Menu mnuHelpDash Caption = "-" End Begin Menu mnuHelpAbout Caption = "&About..." End End Dim LocalGoalType As String Dim LocalFormNumb As Variant Sub CheckEntries () 'Checks to see if enough information is filled out 'to allow calculation or graph and grid If (Val(txtAge) >= 1 And Val(txtAge) <= 50) And (Val(txtColAge) >= 1 And Val(txtColAge) <= 50) And Val(txtColAge) > Val(txtAge) And Val(txtColAnnCost) > 0 And Val(txtColIncrease) > 0 And Val(txtColIncrease) <= 50 And Val(txtColIntRate) > 0 And Val(txtColIntRate) <= 50 And (Val(txtColYears) >= 1 And Val(txtColYears) <= 10) Then cmdCalc.Enabled = True: cmdGraph.Enabled = True: cmdGrid.Enabled = True ButtonsVisible mnuGraph.Visible = True mnuGrid.Visible = True Else cmdCalc.Enabled = False: cmdGraph.Enabled = False: cmdGrid.Enabled = False ButtonsHide mnuGraph.Visible = False mnuGrid.Visible = False End If End Sub Sub CheckHide () 'Checks to see if the graph and grid buttons should be hidden HideButtons = True For i = 0 To forms.Count - 1 If (forms(i).Tag = "College" Or forms(i).Tag = "General") And forms(i).Caption <> Caption Then HideButtons = False End If Next If HideButtons Then ButtonsHide End Sub Sub CmdCalc_Click () lblAmtYearly = Format$(colpmt(Val(txtColAnnCost), Val(txtColIncrease) / 100, Val(txtColIntRate) / 100, Val(txtColAge) - Val(txtAge), Val(txtColYears), Val(txtColSaved), 1), " $##,###,###,###") lblAmtMonthly = Format$(colpmt(Val(txtColAnnCost), Val(txtColIncrease) / 100, Val(txtColIntRate) / 100, Val(txtColAge) - Val(txtAge), Val(txtColYears), Val(txtColSaved), 2), " $##,###,###,###") LblColTotalCost = Format$(TotalColCost, " $##,###,###,###") 'change the default button to be the grid button cmdCalc.Default = False: cmdGrid.Default = True End Sub Sub CmdGraph_Click () IntRate = txtColIntRate / 100 Divider = 100 Periods = Val(txtColAge) - Val(txtAge) + Val(txtColYears) - 1 AmtToSave = colpmt(Val(txtColAnnCost), Val(txtColIncrease) / Divider, Val(txtColIntRate) / Divider, Val(txtColAge) - Val(txtAge), Val(txtColYears), Val(txtColSaved), 1) 'Call the GraphIt routine GraphIt (Tag), txtColName, IntRate, Periods, Val(txtColSaved), AmtToSave, TotalColCost, Val(txtColAge), Val(txtAge), Divider, Val(txtColAnnCost), Val(txtColIncrease), 2 End Sub Sub CmdGrid_Click () FormNumb = LocalFormNumb: GoalType = LocalGoalType cmdCalc.Value = -1 'change the default button to be the graph button cmdGrid.Default = False: cmdGraph.Default = True 'call the GridSetup routine GridSetup 2, txtColName, Val(txtColAge) - Val(txtAge) + Val(txtColYears) - 1, 0, Val(txtColIntRate), Val(txtColSaved), Val(txtColAge), Val(txtAge), Val(txtColYears), Val(txtColAnnCost), Val(txtColIncrease) End Sub Sub Form_Activate () CheckEntries End Sub Sub Form_Deactivate () CheckHide End Sub Sub Form_Load () LocalGoalType = "College" LocalFormNumb = ColForm Col(ColForm).Caption = "College Goal #" + Str$(ColForm + 1) Col(ColForm).Tag = "College" ' ColForm = ColForm + 1 'Disable buttons till enough information is filled out cmdCalc.Enabled = False: cmdGraph.Enabled = False: cmdGrid.Enabled = False End Sub Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer) CheckHide End Sub Sub HsbAge_Change () 'Change the text when the horizontal scroll bar changes txtAge = HsbAge End Sub Sub HsbAge_Scroll () 'Change the text when the horizontal scroll bar changes txtAge = HsbAge End Sub Sub HsbColAge_Change () 'Change the text when the horizontal scroll bar changes txtColAge = HsbColAge End Sub Sub HsbColAge_Scroll () 'Change the text when the horizontal scroll bar changes txtColAge = HsbColAge End Sub Sub HsbColYears_Change () 'Change the text when the horizontal scroll bar changes txtColYears = HsbColYears End Sub Sub HsbColYears_Scroll () 'Change the text when the horizontal scroll bar changes txtColYears = HsbColYears End Sub Sub mnuArrangeIcons_Click () 'Arrange all iconized child forms frmMDI.Arrange ARRANGE_ICONS End Sub Sub mnuCascade_Click () 'Cascade child forms frmMDI.Arrange CASCADE End Sub Sub mnuComGraph_Click () 'Graph the combined graph FormSelectProc "Graph" End Sub Sub mnuComGrid_Click () 'Grid the combined grid FormSelectProc "Grid" End Sub Sub mnuExit_Click () 'When the user chooses File Exit in an MDI Application, unload 'the MDI form to invoke the QueryUnload event for every open child. Unload frmMDI If SelectCancel = True Then Exit Sub End If End End Sub Sub mnuHelpAbout_Click () frmAbout.Show 1 End Sub Sub mnuHelpInstructions_Click () ' Display Help R = WinHelp(hWnd, App.HelpFile, HELP_INDEX, 0) End Sub Sub mnuNewCGoal_Click () 'New College goal NewCGoal End Sub Sub mnuNewGGoal_Click () 'New General goal NewGGoal End Sub Sub mnuNewSPlan_Click () If NeedToSave Then CheckToSave If SelectCancel = True Then Exit Sub End If NewSavePlan MsgBox "Choose New College Goal or New General Goal" End Sub Sub mnuOpenSPlan_Click () If NeedToSave Then CheckToSave If SelectCancel = True Then Exit Sub End If NewSavePlan FOpenProc End Sub Sub mnuSaveAsSPlan_Click () For i = 0 To forms.Count - 1 If forms(i).Tag = "College" Or forms(i).Tag = "General" Then SavePlanNeeded = True End If Next If SavePlanNeeded Then SaveAsPlan End Sub Sub mnuSaveSPlan_Click () For i = 0 To forms.Count - 1 If forms(i).Tag = "College" Or forms(i).Tag = "General" Then SavePlanNeeded = True End If Next If SavePlanNeeded Then SavePlan End Sub Sub mnuSelGraph_Click () 'Click the Graph button on the form cmdGraph.Value = -1 End Sub Sub mnuSelGrid_Click () 'Click the Grid button on the form cmdGrid.Value = -1 End Sub Sub mnuToolbar_Click () OptionsToolbarProc Me End Sub Sub txtAge_Change () If IsNumeric(txtAge) And (Val(txtAge) >= 1 And Val(txtAge) <= 50) Then txtAge = CLng(txtAge) HsbAge = txtAge End If CheckEntries NeedToSave = True End Sub Sub txtAge_GotFocus () 'Select whatever is already typed for editing txtAge.SelStart = 0 txtAge.SelLength = Len(txtAge.Text) End Sub Sub txtAge_LostFocus () 'Update horizontal scroll bar If IsNumeric(txtAge) And (Val(txtAge) >= 1 And Val(txtAge) <= 50) Then txtAge = CLng(txtAge) HsbAge = txtAge ElseIf txtAge = "" Then txtAge = 1 Else MsgBox "This entry needs to be numeric and between 1-50!" txtAge.SetFocus End If End Sub Sub txtColAge_Change () If IsNumeric(txtColAge) And (Val(txtColAge) >= 1 And Val(txtColAge) <= 50) Then txtColAge = CLng(txtColAge) HsbColAge = txtColAge End If CheckEntries NeedToSave = True End Sub Sub txtColAge_GotFocus () 'Select whatever is already typed for editing txtColAge.SelStart = 0 txtColAge.SelLength = Len(txtColAge.Text) End Sub Sub txtColAge_LostFocus () 'Update horizontal scroll bar If IsNumeric(txtColAge) And (Val(txtColAge) >= 1 And Val(txtColAge) <= 50) Then txtColAge = CLng(txtColAge) HsbColAge = txtColAge ElseIf txtColAge = "" Then txtColAge = 19 Else MsgBox "This entry needs to be numeric, between 1-50 and > Age !" txtColAge.SetFocus End If End Sub Sub txtColAnnCost_Change () CheckEntries NeedToSave = True End Sub Sub txtColAnnCost_GotFocus () 'Select whatever is already typed for editing txtColAnnCost.SelStart = 0 txtColAnnCost.SelLength = Len(txtColAnnCost.Text) End Sub Sub txtColAnnCost_LostFocus () 'Update horizontal scroll bar If IsNumeric(txtColAnnCost) Then txtColAnnCost = CLng(txtColAnnCost) ElseIf txtColAnnCost = "" Then Else MsgBox "This entry needs to be numeric!" txtColAnnCost.SetFocus End If End Sub Sub txtColIncrease_Change () CheckEntries NeedToSave = True End Sub Sub txtColIncrease_GotFocus () 'Select whatever is already typed for editing txtColIncrease.SelStart = 0 txtColIncrease.SelLength = Len(txtColIncrease.Text) End Sub Sub txtColIncrease_LostFocus () 'Update horizontal scroll bar If IsNumeric(txtColIncrease) And Val(txtColIncrease) <= 50 Then txtColIncrease = CSng(txtColIncrease.Text) ElseIf txtColIncrease = "" Then Else MsgBox "This entry needs to be numeric and <= 50!" txtColIncrease.SetFocus End If End Sub Sub txtColIntRate_Change () CheckEntries NeedToSave = True End Sub Sub txtColIntRate_GotFocus () 'Select whatever is already typed for editing txtColIntRate.SelStart = 0 txtColIntRate.SelLength = Len(txtColIntRate.Text) End Sub Sub txtColIntRate_LostFocus () 'Update horizontal scroll bar If IsNumeric(txtColIntRate) And Val(txtColIntRate) <= 50 Then txtColIntRate = CSng(txtColIntRate) ElseIf txtColIntRate = "" Then Else MsgBox "This entry needs to be numeric and <= 50" txtColIntRate.SetFocus End If End Sub Sub txtColName_Change () NeedToSave = True End Sub Sub txtColName_GotFocus () 'Select whatever is already typed for editing txtColName.SelStart = 0 txtColName.SelLength = Len(txtColName.Text) End Sub Sub txtColName_LostFocus () If txtColName <> "" Then Caption = txtColName End If End Sub Sub txtColSaved_Change () NeedToSave = True End Sub Sub txtColSaved_GotFocus () 'Select whatever is already typed for editing txtColSaved.SelStart = 0 txtColSaved.SelLength = Len(txtColSaved.Text) End Sub Sub txtColSaved_LostFocus () If IsNumeric(txtColSaved) Then txtColSaved = CLng(txtColSaved) ElseIf txtColSaved = "" Then Else MsgBox "This entry needs to be numeric!" txtColSaved.SetFocus End If End Sub Sub txtColYears_Change () If IsNumeric(txtColYears) And (Val(txtColYears) >= 1 And Val(txtColYears) <= 10) Then HsbColYears = txtColYears End If CheckEntries NeedToSave = True End Sub Sub txtColYears_GotFocus () 'Select whatever is already typed for editing txtColYears.SelStart = 0 txtColYears.SelLength = Len(txtColYears.Text) End Sub Sub txtColYears_LostFocus () 'Update horizontal scroll bar If IsNumeric(txtColYears) And (Val(txtColYears) >= 1 And Val(txtColYears) <= 10) Then txtColYears = CLng(txtColYears) HsbColYears = txtColYears ElseIf txtColYears = "" Then txtColYears = 4 Else MsgBox "This entry needs to be numeric and between 1-10!" txtColYears.SetFocus End If End Sub