AndrewWolford
MIS
Here's my problem:
I'm trying to write a query that selects a field from a table (easy part) based on a user-specified field (hard part). I have a form with a text box (txtUnion). I want whatever fieldname the user types in this text box to be selected from the table (testdata). Here's the query I've tried that doesn't work:
select forms![union].[txtUnion] from testdata;
Access doesn't recognize that what the user types in is a field name and should pull that field name. Instead the query just spits back what the user typed in. How can I make the SQL statement realize that I want to pull the field the user enters? Does anyone know how to do this?
PS I'm not married to using a form as my user input
Thanks for any help,
Andrew
I'm trying to write a query that selects a field from a table (easy part) based on a user-specified field (hard part). I have a form with a text box (txtUnion). I want whatever fieldname the user types in this text box to be selected from the table (testdata). Here's the query I've tried that doesn't work:
select forms![union].[txtUnion] from testdata;
Access doesn't recognize that what the user types in is a field name and should pull that field name. Instead the query just spits back what the user typed in. How can I make the SQL statement realize that I want to pull the field the user enters? Does anyone know how to do this?
PS I'm not married to using a form as my user input
Thanks for any help,
Andrew