asingh
06-18-2007, 02:35 AM
Hi,
I need help to sort out the following logic...
I have a certain table : tbl_all_data, which has columns...a,b,c,d,e,f,g.
I want to create a list box, which displays the names of these columns from tbl_all_data. So when the users chooses....a,d,g.....I pull only columns...a,d,g from tbl_all_data.
What I have thought of so far....
1. How do I get the columns names for tbl_all_data. Once I can isolate the column names I can push those names into another storage table. And display these values on the list box.
2. Once the user makes a choice of a,d,g...I again push these three names into another storage table.
3. Then I run a DLL query....CREATE TABLE new_data (a TEXT, d TEXT, g TEXT)...this will create a holding table for my new data.
4. ThenI run a SELECT query based on my Column Selection. I do not remember the exact syntax, but Access-VBA allows you to dynamically feed the columns name as a variable and run the select. I Append the output of this select into the new_data table.
Problem:
How do I just get the columns names for the tbl_all_data. Meaning dynamically..since the column names for tbl_all_data can vary, depending on some processing which has happened, prior to the column selection by the user....!
Let me know the best way to do this....or if my logic..is inconsistent...!
thanks a lot for the help...
regards,
asingh
I need help to sort out the following logic...
I have a certain table : tbl_all_data, which has columns...a,b,c,d,e,f,g.
I want to create a list box, which displays the names of these columns from tbl_all_data. So when the users chooses....a,d,g.....I pull only columns...a,d,g from tbl_all_data.
What I have thought of so far....
1. How do I get the columns names for tbl_all_data. Once I can isolate the column names I can push those names into another storage table. And display these values on the list box.
2. Once the user makes a choice of a,d,g...I again push these three names into another storage table.
3. Then I run a DLL query....CREATE TABLE new_data (a TEXT, d TEXT, g TEXT)...this will create a holding table for my new data.
4. ThenI run a SELECT query based on my Column Selection. I do not remember the exact syntax, but Access-VBA allows you to dynamically feed the columns name as a variable and run the select. I Append the output of this select into the new_data table.
Problem:
How do I just get the columns names for the tbl_all_data. Meaning dynamically..since the column names for tbl_all_data can vary, depending on some processing which has happened, prior to the column selection by the user....!
Let me know the best way to do this....or if my logic..is inconsistent...!
thanks a lot for the help...
regards,
asingh