This topic is locked

Before Add /Update events

12/19/2006 3:11:49 AM
ASPRunnerPro General questions
D
duda.gergely author

While adding a new record I would like to add the userid from session.

So I have chosen:

Add page

Before record added

and added the next function:
Function BeforeAdd(dict)
userid=session("userid")

BeforeAdd = True
End Function
Still it does not insert the value into the table.

Last week it was working, but now...

Any ideas, what have I done wrong?

Thanx!

J
Jane 12/19/2006

Hi,
here is the correct event code:

Function BeforeAdd(dict)

dict("userid")=Session("UserID")

BeforeAdd = True
End Function



where userid is your actual field name.

Please note that field names are case sensitive here.

D
duda.gergely author 12/19/2006

Hi, it works!!!

Thanx a lot, merry christmas!!!

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=13979&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

Hi,

here is the correct event code:
where userid is your actual field name.

Please note that field names are case sensitive here.