This topic is locked

information fields

4/26/2008 7:09:58 PM
ASPRunnerPro General questions
Y
yairilan author

Hi,

In this link it's written:

I have some information fields from other tables that I use on my edit page as READ ONLY to help the user with the fields to be edited.


How it can be done? Can we add a field from another table to Edit/Add page and control the value by the user?

TxVery Much

Sergey Kornilov admin 4/28/2008

You can use JOIN SQL query to pull data from more than one table.
Make sure you setting "Edit as" type of joined fields to Readonly.

Y
yairilan author 4/28/2008

Tx Sergey. you are a genius!!!!!!! It was very helpfull !!! but now I have one ,ore problem cause I can't add a record:
How can I make it A lookup field that is depended on another field and still a "read only" that will let me add/save the record ?

I can't do it with default value cause it's depended on a user's choice...

J
Jane 4/29/2008

Hi,
unfortunately there is no easy way to set up dependent dropdown box as readonly.

As workaround I recommend you to remove this field from the add/edit pages and fill it in the Before record added/updated events.

Here is a sample:

str = "select FieldName2 from LookupTableName where FieldName='" & dict("FieldName") & "'"

Set rsTemp = server.CreateObject("ADODB.Recordset")

rsTemp.open str, dbConnection
dict("FieldName2") = rsTemp("FieldName2")

rsTemp.Close : set rsTemp = Nothing