473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

HELP with Financial.DDB

Really need some help with the code below. How to I convert the financial.ddb method to give me an outoput calculation equal to the method... when I run the code, my label only shows 0 when I should be getting some kind of calculation. Financial.ddb is basically Depreciation / Period = ((Cost – Salvage) * Factor) / Life

My code uses a list box for life and I have a feeling that this is the culprit... can someone PLEASE help!

code

Public Class Form1

Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click
Me.Close()

End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim code As Integer = 3
Do While code <= 20
lifeListBox.Items.Add(code.ToString)
code = code + 1
Loop
lifeListBox.Items(0) = 3
lifeListBox.Items(1) = 4
lifeListBox.Items(2) = 5
lifeListBox.Items(3) = 6
lifeListBox.Items(4) = 7
lifeListBox.Items(5) = 8
lifeListBox.Items(6) = 9
lifeListBox.Items(7) = 10
lifeListBox.Items(8) = 11
lifeListBox.Items(9) = 12
lifeListBox.Items(10) = 13
lifeListBox.Items(11) = 14
lifeListBox.Items(12) = 15
lifeListBox.Items(13) = 16
lifeListBox.Items(14) = 17
lifeListBox.Items(15) = 18
lifeListBox.Items(16) = 19
lifeListBox.Items(17) = 20

End Sub


Private Sub DDSButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DDSButton1.Click

Dim cost As Double
Dim life As Double
Dim period As Double
Dim salvage As Double
Dim depreciation As Double
Dim isConvertedCost As Boolean
Dim isConvertedLife As Boolean
Dim isConvertedSalvage As Boolean
Dim depriciation As Double
isConvertedCost = Double.TryParse(assetcostTextBox.Text, cost)
isConvertedLife = Double.TryParse(lifeListBox.Text, life)
isConvertedSalvage = Double.TryParse(salvagevalueTextBox.Text, salvage)

If isConvertedCost AndAlso isConvertedLife AndAlso isConvertedSalvage Then
dsoutTextBox.Text = " Year Depreciation"

For Year As Double = 0.01 To 0.05 Step 0.01
depriciation = Financial.DDB(cost, salvage, life, 1, 2.0)
dsoutTextBox.Text = dsoutTextBox.Text & ControlChars.NewLine & Year.ToString("P0") & depreciation.ToString("C2")

Next Year

dsoutTextBox.Focus()

/code

Thank you!
Dec 16 '10 #1
0 1542

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Obantec Support | last post by:
Hi I have a database supplied to me that was excel but now uploaded to mysql. (the data is out of my hands.) i need to search for 1 of 2 categories against 3 fields with user inputted data. ...
0
by: Johnny | last post by:
hy, i've to comunicates financial data (informations about quotes titles like opening prize, last prise, data and time of quotation, % variations...annual max price and all the possibol data about...
6
by: John Bentley | last post by:
John Bentley writes at this level: If we think about our savings accounts then division never comes in (as far as I can see). We deposit and withdraw exact amounts most of the time. Occasionaly...
9
by: sr | last post by:
There is a System.Math class that is very helpful I couldn't imagine any next generation framework or language without one a Math class! What is the issue with having a System.Financial class for...
4
by: Alphonse Giambrone | last post by:
Not sure where to post this so if anyone has any other suggestion, please post it. A client has asked me to look into the feasability of creating a web based financial application where clients...
3
by: RD | last post by:
Say Company's financial year starts October First and say we are now March 17th. How do you determine which quarter of the Financial year - not the actual year - March 17th is in. Thanks for any...
6
by: Programador | last post by:
I'm getting this error when running this program: Cannot calculate rate using the arguments provided Module Module1 Sub Main() Rate(360, -694.44444444444446, 244274.69178082192) End Sub
2
by: Dip | last post by:
Hello Expert, Here I am asking your help. I have a table with following data: TaskID ParentTaskID TaskName ProjectName 1 1 BA Rail 2 22 ...
0
by: CJ Densmore | last post by:
Hello, any help would be greatly appreciated: I am trying to code a program that takes 2 testbox and a list box contain 3 to 20 years and use the financial.ddb method to output a string cont of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.