CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 BeforeUpdate simple(?) problem

Print topic Send  topic

Author Message
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.
View profile  Send private message
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,
View profile  Send private message
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!
View profile  Send private message
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.
View profile  Send private message
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.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.