Displaying Query Data

  • Thread starter Thread starter dhstein
  • Start date Start date
D

dhstein

I have a feeling that this is not a simple question, but here goes anyway.
I'm writing an application and I set up some controls that invoke a query.
I'd like to display the query in a window instead of the default view, so
that the user can close it easily after viewing. Is this possible or only to
be done by super gurus ? Thanks.
 
bind the query to a form, set up the data display any way you like, and set
up the "close" however you want. queries, like tables, should only be viewed
and interacted with by the user via a form.

hth
 
I have a feeling that this is not a simple question, but here goes anyway.
I'm writing an application and I set up some controls that invoke a query.
I'd like to display the query in a window instead of the default view, so
that the user can close it easily after viewing. Is this possible or only to
be done by super gurus ? Thanks.

Don't open the query at all.

Instead, base a Form on the query... and open the Form!

The command button wizard in the toolbox has an "open form" choice.
 
John W. Vinson said:
Don't open the query at all.

Instead, base a Form on the query... and open the Form!

The command button wizard in the toolbox has an "open form" choice.
 
Thanks for the answer - but how do I base a form on a query - This is in
Access. I see the option to open a form - but the only choices I get are the
2 forms I have - one is the main menu where I'm putting this control and one
is a "Test" form - my query is not a choice. Thanks.

Well, I was assuming this was Access, since this is an Access newsgroup and we
were talking about an Access database...

I'm suggesting that you *create a new Form* using the Form design tools. The
simplest way would be to open your query as a datasheet and use the Autoform
tool; you can customize the form if you wish.

Then use THAT form.

Bottom line: users should NEVER see either a table datasheet or a query
datasheet. Datasheets are simultaneously too limited (very little control over
layout or format) and too powerful (users can edit or delete data); a Form
gives you as the developer the flexibility to specify what the user can see
and do.
 
John W. Vinson said:
Well, I was assuming this was Access, since this is an Access newsgroup and we
were talking about an Access database...

I'm suggesting that you *create a new Form* using the Form design tools. The
simplest way would be to open your query as a datasheet and use the Autoform
tool; you can customize the form if you wish.

Then use THAT form.

Bottom line: users should NEVER see either a table datasheet or a query
datasheet. Datasheets are simultaneously too limited (very little control over
layout or format) and too powerful (users can edit or delete data); a Form
gives you as the developer the flexibility to specify what the user can see
and do.
 
I kniw it's my fault and I apologize in advance, but ... My query shows as a datasheet view - 5 columns. When I created it as a form and then opened it from the Command button (Open as form) I get a form that allows me to change the records one at a time. I know that's not what you're talking about, but I don't see how to do it.

Change the Default View property of the Form to "Datasheet" if you like that
look. Or, change it to Continuous Forms and show multiple rows. The autoform
is JUST A START; you're not obliged to accept it as is!
 
John W. Vinson said:
Change the Default View property of the Form to "Datasheet" if you like that
look. Or, change it to Continuous Forms and show multiple rows. The autoform
is JUST A START; you're not obliged to accept it as is!

First of all thanks for being patient with this request. I'm a little new
to this stuff. Here's the thing. My Query generates 5 columns of data
showing all the records that satisfy the query. My test data is only 15
lines so it fits on one page when the query tab pops up. I'm trying to set
up the form as you suggest, but when I do (and I set it to continuous) I get
a form that shows each result row as a form - as if you could enter data
there - and I can scroll down as far as I want. That isn't what I'm trying
to do. I want the 5 columns to still be displayed as they are, but in a
window type display so that the user can use the scroll bar or the mouse
wheel to page down through the hundreds of records that will be returned with
the real data. It may be that this is something that can be done by "binding
a query to a form" but so far I can't see how to do it. Thanks for your
help and any more information is appreciated.
 
If you're in a situation where the user needs to see some fields and not
others, or the underlying query changes - instead of displaying contact
addresses, you're displaying part information - hit us back as its entirely
possible the design of the form on the fly.
 
David H said:
If you're in a situation where the user needs to see some fields and not
others, or the underlying query changes - instead of displaying contact
addresses, you're displaying part information - hit us back as its entirely
possible the design of the form on the fly.




The underlying query doesn't change. I want the user to see the results of
the query in a "Windows" type display - with a scroll bar etc. so that he
can scroll through the results - again there will be hundreds of records
shown from the results of the query. The query is reading inventory records
from the database and returning the inventory items that match the criteria.
It isn't for the purpose of updating the records - it's to get information.
So if there are hundreds of rows, a Windows type display is better than a
datasheet display. Thanks.>
 
First of all thanks for being patient with this request. I'm a little new
to this stuff. Here's the thing. My Query generates 5 columns of data
showing all the records that satisfy the query. My test data is only 15
lines so it fits on one page when the query tab pops up. I'm trying to set
up the form as you suggest, but when I do (and I set it to continuous) I get
a form that shows each result row as a form - as if you could enter data
there - and I can scroll down as far as I want. That isn't what I'm trying
to do. I want the 5 columns to still be displayed as they are, but in a
window type display so that the user can use the scroll bar or the mouse
wheel to page down through the hundreds of records that will be returned with
the real data. It may be that this is something that can be done by "binding
a query to a form" but so far I can't see how to do it. Thanks for your
help and any more information is appreciated.

It may be easier then to build the form from scratch.

Delete the autoform, as it's apparently not helping much.

Create a new Form using the "Create form using wizard" option on the Forms
window.
Select your query when asked for the source of the data.
Select the fields you want to see (probably all of them).
Choose "Tabular" using the radio buttons.
Default the rest of the choices.

These instructions apply to A2000 - 2002 - 2003, not sure how this works in
2007.
 
You're actually looking at a technique called QUERY BY FORM.

http://support.microsoft.com/default.aspx/kb/304428

A very common implementation of QBF is to place the unbound fields that
serve to capture the WHERE criteria on the same form that the results will be
displayed on. The result can be displayed in a subform or in list box. I
typically use the later. Once the user updates the fields or (clicks on a
command button) the subform or listbox is requeried.

David H
 
Back
Top