Dorin
Posts: 50
|
Posted: 06/21/2012, 2:00 AM |
|
Hello,
I have a record form with a hidden field B_STATE who could takes the values 0 or 1. For that I have make a comparison in the BeforeUpdate event of the form. I use the following code:
Dim Total
Dim Budget
Total = CCDLookUp("sum(Price)", "InternalOrders", "id=" &_
DBConnection1.ToSQL(Record.id.Value, ccsInteger), DBConnection1)
Budget = CCDLookUp("budget", "budgets", "IdOperator=" &_
DBConnection1.ToSQL(Record.ATTN.Value, ccsInteger), DBConnection1)
If Budget > 0 and Total < Budget Then
Record.B_STATE.Value= 1
Else
Record.B_STATE.Value= 0
End if
The code works without error but the value of B_STATE is always 1 even the comparison is false.
What could be wrong?
Thanks.
|
|
|
rowling2012a
Posts:
|
Posted: 06/22/2012, 2:01 AM |
|
http://www.cheapairjordans-retro.com , Retro Jordans , Retro Jordans, http://www.cheapairjordans-retro.com , Cheap Jordan Shoes , Cheap Jordan Shoes, http://www.cheapairjordans-retro.com/air-jordan-1-c-100.html , Air Jordan 1 , Air Jordan 1, http://www.cheapairjordans-retro.com/air-jordan-3-c-114.html , Air Jordan 3 , Air Jordan 3, http://www.cheapairjordans-retro.com/air-jordan-6-c-117.html , Air Jordan 6 , Air Jordan 6, http://www.cheapairjordans-retro.com/air-jordan-11-c-102.html , Air Jordan 11 , Air Jordan 11, http://www.cheapairjordans-retro.com/air-jordan-13-c-104.html , Air Jordan 13 , Air Jordan 13,
|
|
|
mljonzs
Posts: 124
|
Posted: 06/22/2012, 8:08 AM |
|
Try casting your variables like this:
If CInt(Budget) > 0 and CInt(Total) < CInt(Budget) Then
_________________
What does not begin WITH God, will end in failure!
|
|
|
Dorin
Posts: 50
|
Posted: 06/22/2012, 8:32 AM |
|
Quote mljonzs:
Try casting your variables like this:
If CInt(Budget) > 0 and CInt(Total) < CInt(Budget) Then
I'll give it a try. Thanks for your suggestion.
|
|
|
Dorin
Posts: 50
|
Posted: 06/26/2012, 12:21 AM |
|
It's not working. I tried to use the After Update Event but with no luck. I think I have to find other approach.
|
|
|
|