This topic is locked

Multiple events in Table Events -> Edit Page

1/26/2006 7:55:35 AM
ASPRunnerPro General questions
B
blacksuperman author

Sergey,
I love what I see in the 4.0 beta now. I am also looking for a way to do mutiple events in the Table Events -> Edit Page section. I want to write some logging info to a table (this works) and then update a field from the recently modified record. My second action doesn't seem to fire although I have commented out the update code and asked for something to be preinted to the screen. Any ideas?
Thank you,

Dave
Sub AfterEdit()

'** Insert a record into another table ****

strSQLInsert= "insert into tbl_Audit (ID,User,Updated,Type) values ('"& GetRequestForm("saveid") &"','" & Session("UserID") & "', Now(), '"& "Table being edited" & "')"
dbConnection.Execute strSQLInsert
'** Custom code ****

' put your custom code here

strSQLUpdate ="test"

if GetRequestForm("OD") <>"" then

strSQLUpdate ="UPDATE tbl_MyTable set WeekNum = "

strSQLUpdate =strSQLUpdate & Format(GetRequestForm("OD"), "ww")

strSQLUpdate =strSQLUpdate & "where ID =" & GetRequestForm("ID")

response.write strSQLUpdate

'strSQLUpdate =strSQLUpdate &

'dbConnection.Execute strSQLUpdate

end if

'try to print out either just to see if the second action would fire

Response.write strSQLUpdate

Response.write "strSQLUpdate"
End Sub

admin 1/27/2006

Dave,
probably some error happens during this event execution.
Try to change the way this event is executed to see what happens.
In ..._edit.asp replace
DoEvent "Call AfterEdit()"
with
Call AfterEdit()