Dim y As Single Dim item As String Dim cost As Long Dim n As Long Dim count As Integer Dim amount_deprec As Long Dim total As Long Dim sum As Long cmdStraightline.Enabled = False cmdDoubledecline.Enabled = False cmdFile.Enabled = False count = 0 y = txtPurchase.Text item = txtDescription.Text cost = txtCost.Text n = txtEstimatedlife.Text picDisplay.Print "Description: "; item picDisplay.Print "Year of Purchase: "; y picDisplay.Print "Cost: "; "$"; FormatNumber(cost, 2) picDisplay.Print "Estimated Life: "; n picDisplay.Print "Method of Depreciation: "; "Sum of Years" picDisplay.Print picDisplay.Print picDisplay.Print ""; Tab(10); "Value at"; Tab(27); "Amount Deprec"; Tab(50); "Total Depreciation" picDisplay.Print "Year"; Tab(10); "Beg of Yr"; Tab(27); "during year"; Tab(50); "to End of Year" picDisplay.Print Do sum = n / 2 * (n + 1) amount_deprec = cost * (n / sum)[b]******here is the problem*****[/b] n = n - 1 total = total + amount_deprec picDisplay.Print y; Tab(10); FormatNumber(cost, 2); Tab(27); FormatNumber(amount_deprec, 2); Tab(50); FormatNumber(total, 2) cost = cost - amount_deprec y = y + 1 count = count + 1 Loop Until count = n
MOD EDIT: When posting code...USE CODE TAGS!!!
This post has been edited by JackOfAllTrades: 19 October 2010 - 04:07 AM

New Topic/Question
Reply
MultiQuote








|