Full Version: Print Select Query
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
robby_aube
I have a query that I am using on a form to select which receipt I want to print for a member:

SELECT Members.ID, Members.First, Members.Last, Members.Print
FROM Members;

The thing is that when I look at the list of members to print it will show all members even if they don't have an offering in the offering table.
I tried to add the offering table to the query but it then shows a line for the same member for each offering entered. So then I add the 'DISTINCT' statement which narrows the list to one name for each member that has an entry in the offerings table but I can't click the checkbox to select them to print.

Also I noticed that with the first query that shows one line for each member, there is always a blank row at the bottom and when the checkbox is selected it adds a blank record to the members table. I know I wouldn't check this box but I was thinking if the intended user does this it would be a pain. Is there a way to hide the "New record" Item?

Is there any way that I can do this?
Ender
To get a list of of members that are also in the offering table, but without any offering table data use something like the following:

SELECT ID, First, Last, Print
FROM Members
where id in
(select id from offerings_tbl)

or

(select distinct id from offerings_tbl)

Note: you may wish to change some of your fields names if they are also reserved words as this could cause you some grief later.
robby_aube
Do you mean the feilds like 'First' 'Last' and such?

As for the query, what you sugested it worked.

As for the blank 'new field' entry, is there anything that can be done to hide this?
Ender
Yes, First and Last are both MS Jet SQL Functions and Print is an Access method.

As for the blank new field entry, I'm having a hard time visualizing it, so could someone else please take a stab at that one?
robby_aube
Ohh, yeah I guess I'll have to change those.

For the empty feild I'll try to help this way...

When you look at a table of data you know how the last row is always an empty row to enter a new record in? Well when I use the print select query to display the list of members on my print form that has a list of the names and the checkbox the last entry is that blank record.

Maybe that helps..

Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.