A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Show query results in form



 
 
Thread Tools Display Modes
  #1  
Old November 13th, 2009, 09:50 PM posted to microsoft.public.access.forms
Krr
external usenet poster
 
Posts: 10
Default 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  
Old November 13th, 2009, 10:49 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old November 13th, 2009, 11:37 PM posted to microsoft.public.access.forms
Krr
external usenet poster
 
Posts: 10
Default 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  
Old November 14th, 2009, 01:04 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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  
Old November 14th, 2009, 02:39 AM posted to microsoft.public.access.forms
Krr
external usenet poster
 
Posts: 10
Default 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  
Old November 14th, 2009, 05:53 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.