This topic is locked
[SOLVED]

 Addition and Subtraction Inventory

10/13/2005 7:40:09 PM
ASPRunnerPro General questions
author

I have been trying hard to understand how to use calculated field wit hteh java script and asp function (method 2 stated on tutorials) but have had no luck. Basically what I want to do is a very simple inventory database.

I want the fields Date, CurrentInventory, Addition, and Subtraction.

I just want to be able to enter in a initial amt of inventory (CurrentInventory) and be able to add and subtract from it. So for example I have 100 eggs, when I click add new I want to create a entry with a date on it. From there I can either add more eggs or subtract eggs. Also how do I display the current eggs in the edit field but not have it be editable? Thanks a lot again!!

Sergey Kornilov admin 10/14/2005

Steve,
you can use Edit as - Readonly format for a field that should not be edited (Formatting tab in ASPRunner).
As far as I understand you need to enter some value in Addition or Subtraction field on the Add page, click Save and the CurrentInventory field should change his value.

Is that what you looking for?

500343 10/14/2005

Yes well I have 3 fields. Current, Addition and Subtraction. But I want to be able to add entries and sort them by date. So for example I currently have a qty of on 10/13/05.

When I go to the add page I want hte date 10/14/05 and be able to subtract or add from the current inventory.

So how do I display 100 in the current field and then be able to subtrac or add from there? For example lets say I subtract 10. now the current should be 90. And on the next day say for example 10/15/05 I want the current to show the updated value of 90 and be able to add or subtract from there.

Thanks for all your help again.

500344 10/14/2005

Steve,

you can use Edit as - Readonly format for a field that should not be edited (Formatting tab in ASPRunner).
As far as I understand you need to enter some value in Addition or Subtraction field on the Add page, click Save and the CurrentInventory field should change his value.

Is that what you looking for?



Yeah but when I do this I cant enter in a default value that is always there when I add and edit pages?

Sergey Kornilov admin 10/17/2005

Probably you can create two tables and setup master-details relationship between them.
Inventory (Master table) -> InventoryAdjustments (DetailsTable)
On the InventoryAdjustments Add page you need to run a SQL statement after new adjectment is added. Something like this:

strUpdateSQL = "Update Inventory set CurrentInventory = CurrentInventory + " & CLng(GetRequestForm("Addition"))Â _

& " - " & CLng(GetRequestForm("Subtraction")) & " where InventoryID = " & GetRequestForm("MasterKey")

dbConnection.Execute strUpdateSQL