If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Show query results in form
So I have a combo box listing all the queries in my database. When I choose a
query and click my [Run Query] button I'd like the query to display within a sub form I have below the combo box. I have it working right now writting the query results to a list box in my sub form but I can't edit any of the data. What I'd like is the full query view to show within my sub form so I can edit/sort etc. Thanks, Ken |
#2
|
|||
|
|||
Show query results in form
On Fri, 13 Nov 2009 13:50:01 -0800, KRR wrote:
So I have a combo box listing all the queries in my database. When I choose a query and click my [Run Query] button I'd like the query to display within a sub form I have below the combo box. I have it working right now writting the query results to a list box in my sub form but I can't edit any of the data. What I'd like is the full query view to show within my sub form so I can edit/sort etc. Thanks, Ken Set the Form's Recordsource property to the name of the query in the AfterUpdate event of the combo box. Note that only Select queries (not action queries, such as update or make-table queries) return records, and that some of your queries may require parameters (which might or might not be available). This seems like a VERY VERY strange thing to do. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
Show query results in form
Thanks John but I don't understand how this will work. I can set the record
source easy enough but how do I get the the form to show anything when it doesn't have any fields defined on the form? The reason I want to do this is to allow my users to have access to the back end end data for data-cleaning purposes without having to give then access to the database window. ---Ken "John W. Vinson" wrote: On Fri, 13 Nov 2009 13:50:01 -0800, KRR wrote: So I have a combo box listing all the queries in my database. When I choose a query and click my [Run Query] button I'd like the query to display within a sub form I have below the combo box. I have it working right now writting the query results to a list box in my sub form but I can't edit any of the data. What I'd like is the full query view to show within my sub form so I can edit/sort etc. Thanks, Ken Set the Form's Recordsource property to the name of the query in the AfterUpdate event of the combo box. Note that only Select queries (not action queries, such as update or make-table queries) return records, and that some of your queries may require parameters (which might or might not be available). This seems like a VERY VERY strange thing to do. -- John W. Vinson [MVP] . |
#4
|
|||
|
|||
Show query results in form
On Fri, 13 Nov 2009 15:37:01 -0800, KRR wrote:
Thanks John but I don't understand how this will work. I can set the record source easy enough but how do I get the the form to show anything when it doesn't have any fields defined on the form? Oh... sorry... should have said. A Datasheet form would be the only practical option if you can't define the query's structure ahead of time. -- John W. Vinson [MVP] |
#5
|
|||
|
|||
Show query results in form
But when switching from query to query do I not need a way to clear the form
of all previous fields and recreate the fields for the new query so they'll show up in datasheet view? Thanks, Ken "John W. Vinson" wrote: On Fri, 13 Nov 2009 15:37:01 -0800, KRR wrote: Thanks John but I don't understand how this will work. I can set the record source easy enough but how do I get the the form to show anything when it doesn't have any fields defined on the form? Oh... sorry... should have said. A Datasheet form would be the only practical option if you can't define the query's structure ahead of time. -- John W. Vinson [MVP] . |
#6
|
|||
|
|||
Show query results in form
On Fri, 13 Nov 2009 18:39:01 -0800, KRR wrote:
But when switching from query to query do I not need a way to clear the form of all previous fields and recreate the fields for the new query so they'll show up in datasheet view? Ummmm... did you try it? -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|