DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: urgent help

  1. #1
    Join Date
    Jan 2008
    Posts
    13

    urgent help

    pease can somone help me with the following program:

    its an investment calculator. i can't get the add to portfolio button working, it does work but the amount is zero.

    i can't also display currency in my program.
    Code:
    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
    Last edited by Hack; 02-29-2008 at 07:49 AM. Reason: Added Code Tags

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    I don't see where you're setting Initial or PV to any value.

    This line should work to display currency, as long as Initial has some value greater than zero: txtInitial.Text = Format(Initial, "Currency")
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Replies: 4
    Last Post: 01-17-2008, 10:45 AM
  2. Replies: 1
    Last Post: 05-31-2007, 09:02 PM
  3. Replies: 1
    Last Post: 05-21-2005, 11:11 AM
  4. URGENT.. URGENT... PLEASE HELP US
    By precious in forum Enterprise
    Replies: 2
    Last Post: 06-23-2001, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center