I have a combo box with list all the queries I have on my database:
Form is called: frm_qry_slct
Combo box (Unbound): Combo23
RowSourceType: Table/Query
RowSoource:SELECT [Name] FROM MSysObjects WHERE [Type]=5 And [Name] Like "qry_#*" ORDER BY [Name];
Then my SubForm
I have a command button on the form just below the sub form to extract the query result into excel with the following code:
DoCmd.OpenQuery "Name of my query", acViewNormal
RunCommand acCmdOutputToExcel
How do I populate the subform based on the query selected on the combo box?
Thanks in advance, not really confident in vba, all the codings I know are taken from forums.
Thanks in advance
D
|