Referring to a database column based on selected item

I am trying to implement a way of editing a whole range of variable valuelists.

I am trying to refer to a database field based on a different selection from a fixed value list that stores within it the database field name which store my value list data.

Can i refer to a selected record field by a variable?

my best effort so far, which is of course wrong is

globals.valuelist_tempname=selectedrecord[globals.valuelist_sel]

where selected record is trying to reutrn the text in the variable field defined in the result of my fiexd value list?

Can i refer to a database field in a variable way like i can an element?

David

Hi David,

dpearce:
Can i refer to a selected record field by a variable?

Yes you can refer to a columnname via a variable.
As long as the variable holds the name of the column.
Like this:

var sFieldName = "nameOfColumn";
var sFieldvalue = foundset[sFieldName];

Hope this helps.

Thanks i will give that a go.

I am holdng the columne names in a little table that is my value list chooser table, so that should work nicely

David