473,322 Members | 1,188 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,322 software developers and data experts.

Need help with program containing Financial.DDB method

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 "year depriciation" + the financial.ddb calculation. I debug teh program and I keep getting an Argument 'Factor' is not a valid on the financial.ddb calculation line. Can someone assist me and tell me if I coded the program correctly? Here is my code:

Code

Public Class Form1

Private Sub exitButton2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton2.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
End Sub

Private Sub calculateButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles calculateButton1.Click
Dim cost As Double
Dim life As Boolean
Dim salvage As Double
Dim period As Double
Dim number As Integer = 1
Dim startNdx As Integer
Dim highNdx As Integer
Dim fddb As Integer

Double.TryParse(costTextBox1.Text, cost)
Double.TryParse(lifeListBox.Text, life)
Double.TryParse(salvagTextBox.Text, salvage)
period = 2
If cost AndAlso life AndAlso salvage Then
equateTextBox1.Text = " Year Depriciation"
For curNdx = startNdx To highNdx
fddb = Financial.DDB(cost, salvage, life, period)

equateTextBox1.Text = lifeListBox.Text + fddb

Next



Else
MessageBox.Show("ERROR")

End If



End Sub
End Class

/code

I have attached a screen shot of the input gui...

Thanks guys, you are a life saver!
Attached Images
File Type: jpg helpprogram.jpg (15.9 KB, 151 views)
Dec 10 '10 #1
0 1351

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

Similar topics

2
by: Jim | last post by:
I am a FoxPro programmer. What software do I need to program using MS access... I have apps that are non-web standalone and some web based... Do you recommend any learning resources? ...
2
by: Jon Davis | last post by:
The garbage handler in the .NET framework is handy. When objects fall out of scope, they are automatically destroyed, and the programmer doesn't have to worry about deallocating the memory space...
1
by: ad | last post by:
I used login controls in VS2005 in my WebApplicaiton. A user can click LoginStatus to login or logout. Can we login our logout with program just like the use click the LoginStatus?
3
by: Tyler | last post by:
Can someone help by explaining why the following class will not compile (VS2005), and what can be done to pass the function pointer to the "C" method? When I compile the following program, I get...
1
by: cheche | last post by:
hi, help me!!! i need hashing program in C or in Java.. tnx, cheche
4
by: preciouskim | last post by:
Good evening, i was curious if someone is able to help me modify my program. I need the program to processes the following user command^K given through the key board. When this command is given,it...
2
by: Jayram Rout | last post by:
Why do we need to put the Overridden method in a try and catch block if the overridden method does not throw any exception. The code goes here.... class Utils{ int getHeight(String x) throws...
2
mageswar005
by: mageswar005 | last post by:
Hello sir, How can i pass the infinity values from one page to another page with out using post method. 1) I know in Get method some limitations are there.I think Only 1024 ...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.