still having problems

Joined
Jan 24, 2005
Messages
10
Programming Experience
Beginner
im stiill having problems from my previous post i relaly dunno what to do i tried using the break points and i got the values 0D for both of them so maybe i must have it declared somewhere or somethin could someone please help me out it seems theres just one problem that i keep makin but i dunno what it is..here is the exact code i got so far

'Dimension the module level variables
Dim mdecFinalAmount As Decimal I use module level for running totals right cuz ya my balance in the label is a running total

Private Sub btnCalculate_Click....
'Dimension the procedural variables
Dim decDepositPrice As Decimal
Dim decServiceChargePrice As Decimal
Dim decCheckPrice As Decimal

Calculate the balance with checks
If radDeposit.Checked = True Then
mdecFinalAmount += decDepositPrice
lblFinalAmount.Text = FormatCurrency(mdecFinalAmount)
End If
 
Why don't you post all your code for that part. The code you show doesn't do anything by itself. Except for add 0's.
 
Then you are not giving it any details to add, it is checking if it needs to add, and then adding it. But all your giving it to add are 0's.

You don't give a value to:
Dim decDepositPrice As Decimal

So it doesn't seem to add anything because it's value is 0. If you changed that line to:
Dim decDepositPrice As Decimal = 1.1

It will then have something to add.
 
no no see ok sorry i should have explained the deposit, check n service i have in 3 text boxes n when u run the program u input any amount of money u want
 
Okay, to test your code, the entirety of what I'm useing is:

VB.NET:
 Dim mdecFinalAmount As Decimal
	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		'Dimension the procedural variables
		Dim decDepositPrice As Decimal = DepositPrice.Text ' the only change
		Dim decServiceChargePrice As Decimal
		Dim decCheckPrice As Decimal

		'Calculate the balance with checks
		If radDeposit.Checked  = True Then
			mdecFinalAmount += decDepositPrice
			 lblFinalAmoun.Text = FormatCurrency(mdecFinalAmount)
		End If
	End Sub

And using the code exactly like that it works just fine.

For the GUI I have a button(button1), a radiobutton(radDeposit), a label (lblFinalAmoun), and a textbox (DepositPrice). And it seems to work just fine.
 
Just to test it, try changing it to
dim decDepositPrice As Decimal = 1.1

Because it seems to be a problem with another factor, the code I've seen works just fine.
 
Back
Top