Hi,
I would like to display the result of a sql query into a simple table. My sql sentence is embedded in a VBA module.
DoCmd.OpenTable "myTable" works well, but it displays the whole table myTable. However, I would like to get the result filtered and sorted.
I have thought to DoCmd.OpenQuery but it needs the name of a stored query and does not allow a SQL sentence as a parameter.
I have also thought to DoCmd.RunSQL but it does not give the result in a table.
Could you tell me if there is something like
DoCmd.zzzzz "SELECT ... FROM myTable WHERE ... ORDER BY ..."
that displays the result the same way as with DoCmd.OpenTable "mytable"
Thanks.
I would like to display the result of a sql query into a simple table. My sql sentence is embedded in a VBA module.
DoCmd.OpenTable "myTable" works well, but it displays the whole table myTable. However, I would like to get the result filtered and sorted.
I have thought to DoCmd.OpenQuery but it needs the name of a stored query and does not allow a SQL sentence as a parameter.
I have also thought to DoCmd.RunSQL but it does not give the result in a table.
Could you tell me if there is something like
DoCmd.zzzzz "SELECT ... FROM myTable WHERE ... ORDER BY ..."
that displays the result the same way as with DoCmd.OpenTable "mytable"
Thanks.