This topic is locked

Adding Record to another table at point of entry

7/8/2009 7:35:05 PM
ASPRunnerPro General questions
A
Aussie Mick author

Hello everyone. (Sorry I posted this in the wrong forum orginally)
I am stuck with a problem and am calling on some help.
I have two identical tables. One is called Call Log and the other is called History
Both have the following fields
Name

Area

Branch

OFI
What I would like to do is at the point of entry into the call log table, I would like to copy an identical record into the History Table, so that when the record is deleted from Call Log there will always be a record of it in the History Table. The problem is the code has me puzzled.
The Event Builder shows the code
'** Insert a record into another table ****

dal.TableName.Field1=Value1

dal.TableName.Field2=Value2

dal.TableName.Add()
I am not sure waht bits I should update to what. Any advice would be welcomed. I have tried and tried but always get ASP Errors.
Thanks folks
Mick

Sergey Kornilov admin 7/8/2009

Instead of Field1, Field2 and Value1, Value2 you need to use real field names and real values. You need to use a real table name as well.
For example this sample code may look like this (I assume you are talking about BeforeDelete event)

dal.History.Name=deleted_values("Name")

dal.History.Area=deleted_values("Area")

dal.History.Branch=deleted_values("Branch")

dal.History.OFI=deleted_values("OFI")

dal.History.Add()