Display query results

jpl458

Well-known member
Local time
Today, 09:26
Joined
Mar 30, 2012
Messages
1,218
I have form that has Several Buttons that each launches a query. I want to be able to display the results of those queries other than taking up the whole screen. I've read and watched articles and videos regarding sub forms, etc. I want the user to be able to launce a query and have it displayed in a concise manner that the user can close when done. Just don't know the best way of doing that. There is only one table involved.
 
Put the output in a subform?
 
If the user doesn't need to interact with the data you can simply have a list box on the form with a column for each query field and simply set its row source to the selected query in the click event of the button(s).
The advantage of this over using a subform is that if the name of fields change from query to query you need to have a form for each and set that as the source object of the subform control. With the list box you don't need to worry about that, setting the Column Heads property to Yes will display the field names on the first row automatically.

Cheers,
 
The advantage of this over using a subform is that if the name of fields change from query to query you need to have a form for each and set
not entirely true.
you can just set the SourceObject of the subform to whatever query name to show:

me.subformName.SourceObject = "Query.queryNameHere
 

Users who are viewing this thread

Back
Top Bottom