Sorry, I guess I'm a little slow. If I'm trying to use the variable to both display the value and set the column position in the table how would I use the second variable and keep it dynamic?
strSearchby is determined by a radio button selection. It also sets which values are in columns 1, 2 and 3.
If strSearchby = "first" Then
strDesc1 = "First"
strDesc2 = "Last"
strDesc3 = "Ext"
strField1 = "rsObject('first')"
strField2 = "rsObject('last')"
strField3 = "rsObject('ext')"
ElseIf strSearchby = "last" Then
strDesc1 = "Last"
strDesc2 = "First"
strDesc3 = "Ext"
strField1 = "rsObject('last')"
strField2 = "rsObject('first')"
strField3 = "rsObject('ext')"
ElseIf strSearchby = "ext" Then
strDesc1 = "Ext"
strDesc2 = "First"
strDesc3 = "Last"
strField1 = "rsObject('ext')"
strField2 = "rsObject('first')"
strField3 = "rsObject('last')"
End If
'Display recordsets in table
Response.Write "<TR>"
Response.Write "<TD><FONT COLOR='#000066' FACE='arial' SIZE='2'>" & strField1 & "</FONT></TD>"
Response.Write "<TD><FONT COLOR='#000066' FACE='arial' SIZE='2'>" & strField2 & "</FONT></TD>"
Response.Write "<TD><FONT COLOR='#000066' FACE='arial' SIZE='2'>" & strField3 & "</FONT></TD>"
Response.Write "<TD>" & "<FONT COLOR='#000066' FACE='arial' SIZE='2'>" & rsObject("dept") & "</FONT>" & "</TD>"
Response.Write "<TD>" & "<FONT COLOR='#000066' FACE='arial' SIZE='2'>" & rsObject("loc") & "</FONT>" & "</TD>"
Response.Write "</TR>"
If I follow you correctly, you are saying to set a second variable to hold the value of rsObject("x") but still need to plug that back into the table. At that point it's no longer changing based on the radio button selection and I could use rsObject("x") as in the last two columns.
Am I missunderstanding you?