This topic is locked
[SOLVED]

 Foreign key field email

6/14/2010 8:23:16 PM
ASPRunnerPro General questions
D
dem761 author

Has anyone had success emailing fields that refer to other tables for data? What I need to do is email the dropdown field 'NAME' but this field is tied to another table so all I see in the email is a number (the primary key that the dropdown field stores.)
Cheers

J
Jane 6/15/2010

Hi,
you can select value from another table in your event using this code:

set dal_TableName = dal.Table("TableName")

set rstmp = dal_TableName.Query("LinkField=" & values("FieldName"),"")

var_name = rstmp("DisplayField")

rstmp.close

set rstmp=nothing



where LinkField and DisplayField are your actual field names in the lookup table, FieldName is your actual field name in the main table.

D
dem761 author 6/15/2010

That worked perfectly...Thanks Jane!



Hi,
you can select value from another table in your event using this code:

set dal_TableName = dal.Table("TableName")

set rstmp = dal_TableName.Query("LinkField=" & values("FieldName"),"")

var_name = rstmp("DisplayField")

rstmp.close

set rstmp=nothing



where LinkField and DisplayField are your actual field names in the lookup table, FieldName is your actual field name in the main table.