Re: vb Project Help

  • From: "Bob J." <rjustice004@xxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 26 Dec 2008 12:33:12 -0800

Marvin,

We don't know what values these variables contain at the time when you are
getting $0.08 so that might be the correct value for this particular
calculation.
decOrder = decTotalAmount * decSalesTax

If decTotalAmount = 1.00 and decSalesTax = .08 then decOrder would = .08.

The correct calculation, if all this is true, would be as follows.

decOrder = decTotalAmount + ( decTotalAmount * decSalesTax )

Assuming the values that I guessed at earlier, this calculation would
produce 1.08.

hth

Bob


----- Original Message ----- 
From: "tribble" <lauraeaves@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, December 26, 2008 8:27 AM
Subject: Re: vb Project Help


I am not a vb programmer, but Marvin, do you initialize all your variables?
in your example, the various dec variables are assumed to be set, except for
decOrder, which is only conditionally set. Do you use this variable later
on? and if so, are you sure it has a value when you reference it?
Just a thought.
--le

----- Original Message ----- 
From: "Ricks Place" <OFBGMail@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, December 26, 2008 8:18 AM
Subject: Re: vb Project Help


Hi Marv:
The if statement is fine.
if strState = "CA" Then
decOrder = decTotalAmount * decSalesTax
end if
The problem is in your calculation. You need to make sure your initial
values are getting updated with either new calculated values or newly
entered values.
Then you need to calculate the Order Amount based on the price of the Item
Ordered and Add in the Calculated Sales Tax. If you do this the If Statement
Syntax should work.
Rick USA
----- Original Message ----- 
From: "Marvin Hunkin" <startrekcafe@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, December 26, 2008 8:04 AM
Subject: vb Project Help


> Hi.
> got an application.
> and here's the basic prmeises.
> got 99% of it working and the correct values.
> but it is one bit which is not working, and tried all sorts of things, and
> it is giving me a migrain.
> so any one help me out with this one?
> okay, you entere details for a store, mail order form.
> you enter name, address,city, state, zip code, description,  quantity
> ,weight of the parcel and price. then you clikc the add this button, and
> it
> gives you the dollar amount, the sales tax if shipped to a california
> address, else, no sales tax which is 8%
> and then the shipping charge based on a series of weights, which i have
> code
> and use a constant called Handling and is $0.25 per pound, that is
> working,
> and then the total cost of the parcel.
> the only problem is i tried to assign a string and then use an if then
> else
> statement.a
> nd in the code set the sales tax variable.
> but what ever i try, it is only giving me $0.08 if i set the state code to
> CA, and it is driving me mad.
> so, how do i get this last little piece to work.
>
> now here's some sample code that i wrote:
>
>
> if strState = "CA" Then
> decOrder = decTotalAmount * decSalesTax
> end if
> what am i doing wrong?
> can any one point me out, where i am going wrong and how to fix this
> little
> annoying thing.
> did have a look in the msdn help, but it said that i could use a string
> constant to use and if then or if then else test.
> and then tried looking on google, for some more information and a couple
> of
> sites i visted, cannot remember the name of the sites, that it was a vb
> dot
> net 2005 sites.
> so can any one help me out here.
> or point me to some good resources, on how to figure this one out.
> this one, i have tried multiple cominbations of arranging variables, in
> different combinations.
> but no result.
> so an i doing some thing wrong?
> let me know.
> cheers Marvin.,
> E-mail: startrekcafe@xxxxxxxxx
> MSN: sttartrekcafe@xxxxxxx
> Skype: startrekcafe
> We Are The Borg! You Will Be Assimilated! Resistance Is Futile!
> Star Trek Voyager Episode 68 Scorpian Part One
> E-mail: startrekcafe@xxxxxxxxx
> MSN: sttartrekcafe@xxxxxxx
> Skype: startrekcafe
> We Are The Borg! You Will Be Assimilated! Resistance Is Futile!
> Star Trek Voyager Episode 68 Scorpian Part One
>
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: