This topic is locked

Auto reduce stockquantity

6/10/2009 8:22:36 AM
ASPRunnerPro General questions
K
karacabeybel author

Hi

I have two tables . (Sales and Products)

Any change salesquantity field in to Sales page (add or edit).

I want auto reduce stockquantity in Products page.

What I do necessary this for?

Is there an example or code?

J
Jane 6/10/2009

Hi,
use After record added/After record updated event on the Events tab.

Here is a sample:

str = "update products set stockquantity=stockquantity-" & values("salesquantity") & " where KeyFieldName=" & values("FieldName")

dbConnection.Execute str



where KeyFieldName and FieldName are your actual field names.

K
karacabeybel author 6/10/2009

Thanks your code very good works.