CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 INSERT INTO if a > b

Print topic Send  topic

Author Message
JimbobGilb

Posts: 28
Posted: 02/22/2013, 6:45 PM

My INSERT INTO code works but i only want to run it if Inventorylots1.Quantity.value > 0

I cannot get an if statement to work.

eg: if Inventorylots1.Quantity.value > 0 then


Dim SQL
Dim Connection
Dim ErrorMessage



Set Connection = New clsDBConnection1
Connection.Open



SQL = "INSERT INTO InventoryLots2 (PartNumber) "&_
"VALUES ("& DBConnection1.ToSQL(inventorylots1.PartNumber.value,ccsText) &")"
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0



Hopefully someone could give me some assistance.

Thanks,
View profile  Send private message
Dorin

Posts: 50
Posted: 03/06/2013, 10:20 AM

Hello,

If you are trying to update a second table, you can use the After Insert event with your code.

Something like this:

If Inventorylots1.Quantity.value > 0 then

Dim SQL
Dim Connection
Dim ErrorMessage

Set Connection = New clsDBConnection1
Connection.Open

SQL = "INSERT INTO InventoryLots2 (PartNumber) "&_
"VALUES ("& DBConnection1.ToSQL(inventorylots1.PartNumber.value,ccsText) &")"
Connection.Execute(SQL)
ErrorMessage = CCProcessError(Connection)
Connection.Close
Set Connection = Nothing
On Error Goto 0

End if
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.

Web Database

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.