If we want to print the query results, then we often use Data Report, here I am talking about directly using the recordset RS to set the data source. In order to quickly add the fields in the query result, let's build a DataEnvironment1, set the connection between DataEnvironment1 in DataEnvironment1, and then right-click the subrup command in the connection1 in DataEnvironment1, right-click, attribute, select SQL statement, write our query statement, and then determine it, you can see the field we want to display. You can add multiple subcommands if needed. Then create a DataReport1, point the Command1 in DataEnvironment1, dragging directly to the detail area in DataReport1, and then adjust each field location according to you. Note that you want to set up the DataMEMBER of each TextBox in the detail area. Then write the code in the program. DIM RSDR As New AdoDB.Recordset
SET RSDR = conn.execute (SQLALL)
Set DrQueryAll.DataSource = RSDR
DRQUERYALL.SHOW