PDA

View Full Version : Making a variable in a textbox represent field name



prince_mallo
05-22-2008, 07:28 AM
Hi I have a table with 15 to 30 yes/no fields represented by a numerical value..

(in other words a table that looks like this: ID, 1,2,3,4,5)
I'm trying to do a search query that the user would type in the number in a unbound textbox and click a button and it would search for all the instances in which that is not null... So the user would type in 1, and it would search for all the records in which 1 has a true value in it. I am unable to get the variable value converted to a field value, This is the code I am attempting to use.



If fieldnamevariable <> Null Or volume <> "" Then

Form.Filter = "((qryList.[fieldnamevariable].value Is Not Null))"
RunCommand acCmdApplyFilterSort


I would need the fieldnamevariable to parce withing the brackets before it parses the brackets...

Is this humanly possible?:dunno