I am new in vba and specially vba query. My question is following:-
I have a form named "frmCreateQ ry" which have following
FieldType FieldName
1. ComboBox cboSelectTblQry
2. ListBox lstSelectFrom
3. ListBox lstSelectTo
4. Button cmdMove
5. Button cmdExport
cboSelectTblQry rowsource have form Onload value. It contains all table names of my database. When I select any table name from this combobox then all related fields name display in lstSelectFrom (ListBox). If I select any fields from lstSelectFrom and click on cmdMove (Button) then selected fields moves to lstSelectTo.
My question is that I want to create query using lstSelectTo items/fields by clicking cmdExport (Button) and export this query to excel format.
Kindly tell me the process.
Thanks
I have a form named "frmCreateQ ry" which have following
FieldType FieldName
1. ComboBox cboSelectTblQry
2. ListBox lstSelectFrom
3. ListBox lstSelectTo
4. Button cmdMove
5. Button cmdExport
cboSelectTblQry rowsource have form Onload value. It contains all table names of my database. When I select any table name from this combobox then all related fields name display in lstSelectFrom (ListBox). If I select any fields from lstSelectFrom and click on cmdMove (Button) then selected fields moves to lstSelectTo.
My question is that I want to create query using lstSelectTo items/fields by clicking cmdExport (Button) and export this query to excel format.
Kindly tell me the process.
Thanks
Comment