Export part of the table based on user input via form

cutun1217

New member
Local time
Tomorrow, 03:48
Joined
Aug 24, 2006
Messages
8
hi everybody, im have a database with table called "project". there are many column in this table. my user want to export this table to Excel, but only some of column, with particular order ( depend on him) to analyze in Excel.
he asked me to build a form with a list box, drop box,somthing like this, so he can choose what column to export in what order.
i try to make a query like this: " Select Forms!UserInput.combobox1.value , Forms!UserInput.combobox2.value,etc, From Project" but it wont work.
Dou you have any idea.
thanks in advance
 
You need to build the sql in a string and then run the string sql. Might be something like this:
Code:
Dim str_SQL as string

str_SQL = "Select" & [Forms!UserInput.combobox1.value] &  "," & [Forms!UserInput.combobox2.value] & "From Project;"
DoCmd.RunSQL str_SQL
(Untested and written in a hurry!)
 
To cutun1217: please dont post the same topic in this forum ! :(
There re a lot of people who had answered you already. :(
 

Users who are viewing this thread

Back
Top Bottom