This topic is locked

Need Help - Insert Into Other Record

4/5/2010 6:36:08 PM
ASPRunnerPro General questions
D
dean_z author

Hey...
It's me... the newbie... lol...
I need some help and I will prob feel like a fool when someone tells me what i am looking at..
I am trying to figure out how to Insert one field from one record to a field in another record. I am looking at the code that ASPrunnerpro generates, which is this:
dal.TableName.Field1="Value1"

dal.TableName.Field2="Value2"

dal.TableName.Add()
However, what I am having an issue with, is understanding what goes into what field... I would assume that the Tablename is the table that you want the info to drop to. I can assume that field1, is the field of the record that is being copied over.
I am not sure what to put for "Value1"... and I know its not Value1..LOL Can anyone help this struggling newbie?
Thanks,

Dean

Sergey Kornilov admin 4/5/2010

You guessing it right, Tablename is the name of table where you insert the record, Field1 is the name of field. The main question is how do you choose the source record?
Related question - where this code goes to?
For example, in AfterAdd event you can use the following:

dal.Cars.Make=values("MyMake")

dal.Cars.Model=("MyModel")

dal.Cars.Add()


In this example MyMake and MyModel are fields on the Add page of another table.