Hi,
I have two questions.
I have some values that are read from a Mysql db.
I would like to setup some basic calculations.
Say I have a field called "In stock" and another field called "sold" and a field called "Base stock"
Now each time a new entry is added (add form) the stock field should contain the value of the BASE STOCK minus Qty Sold goods OF THE PREVIOUS ENTRY
So suppose I have an entry BASE STOCK = 10 AND SOLD = 5 then everytime a new entry is added the base stock of the new entry must be the calculation of the previous entry. How can I achieve this?
Second, it seems that something like
Dim Stock
Dim Sold
Dim Total
Stock =dict("base_Stock")
Sold = dict("Sold")
Total = clng(val(stock)) - clng(val(sold))
dict("CalculatedTotal") = Total
works only when all field are textfield. If one of them is readonly, it returns a zero even if it hold another value.
Plz help me out with these 2 questions
Hans