Douglas,
Here is a sample of the code that I am using to calculate a bonus
amount:
If Qnty >= 600 And Qnty <= 699.99 Then
BnsAmnt = 0.25
ElseIf Qnty <= 799.99 Then
BnsAmnt = 0.5
ElseIf Qnty <= 899.99 Then
BnsAmnt = 0.75
ElseIf Qnty <= 999.99 Then
BnsAmnt = 1
If the amount is less that 0.51 my control is rounding down to 0.
If the amount is 0.51 or greater it is rounding to 1.
The control is set to a "Currency" format with the decimal places
set to 2. I don't know what else to look at.
The calculations are being made in a module and being shown in an
unbound control on a form. I will not be storing this data at this
time but it will become important later as I complete my project.
Any help would be greatly appreciated. Thanks.
In the module, usually right below the module declaration, you need
to declare the variable and set it to 0.
Dim BnsAmnt as double
BnsAmnt = 0
Also, your test for >= 600 is not logical. Say Qnty = 500.
the If rejects it (>=600), so the code moves to the first ElseIf,
which accepts it, because it does not know about the lower limit in
the statement above..
you can either move the first test to a separate line
If Qnty < 600 Then
' do nothing
ElseIf Qnty < 700 then
BnsAmnt = 0.25
etc