This topic is locked

default values thru edit page?

6/21/2006 4:06:42 PM
ASPRunnerPro General questions
S
SteveL author

Hi, Im trying to use the default value options but i noticed the default value I set only shows up when I use the add new record. is it possible to have a default value automatically populate a field when I cilck on edit record?
thanks

J
Jane 6/22/2006

Steve,
use Before record updated event on the Events tab (step 11) for this purpose.

Here is a sample code:

Function BeforeEdit(dict, where)

dict("Field") = "your default value"

BeforeEdit = True
End Function



where Field is your actual field name.

L
luic 8/8/2006

It does not seem working to me.
The field already has a value but I want to override it when editing.
Thanks.
cl

J
Jane 8/9/2006

Chris,
to overwrite value on the EDIT page use following code:

Sub EditOnLoad(where)

strupdate = "update TableName set FieldName='your new value' where "&where

dbConnection.Execute strupdate
End Sub



where TableName is your actual table name, FieldName is your actual field name.