Selecting and Printing Specific Records

H

HankL

Access 2003

Is there a way that I can select specific records from a database to print
out specific columns for those records?
As an example, I have a database of restaurants. I want to select
certain restaurants in that database to print out on a sheet of paper for a
friend.

Thank you in advance for your support and suggestions,

HankL
 
A

Al Campagna

HankL,
Many ways to do that...
If there's no "logical" restaurant selection for printing
(ex. by district, or by city, etc...) think about adding a PrintMe checkbox
field
to your restaurant table.
Set any restaurant record you want printed to chkPrintMe = True, and
have
the reports query use chkPrintMe = True as a criteria to filter the report.

Or use the OpenReport Where argument...
DoCmd.OpenReport "YourRpt", acViewPreview, , "chkPrintMe = True"

Note: you can create a couple of update queries that can run by button
to...
Set All chkPrintMe to False
Set All chkPrintMe to True
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
H

HankL

Hello Al,

Thank you very much for your reply. I just want you to know, that I am a
novice at using Access. I am sorry but I cannot follow your suggestion in
setting up my Restaurant database to include PrintMe..
Your suggestion is an excellent idea and probably is exactly what I need to
be able to select certain restaurants to include on a list to print specific
fields.. 'I went into Design after opening the table and inserted a
checkbox column called PrintME
However I do not know how to 'Set any restaurant record I want printed to
'chkPrintME=True, and have the reports query use chkPrintMe=True as a
criteria to filter the report.'
I would appreciate step x step instructions as to how to accomplish this.
Also, can I just select certain fields such as Restaurant Name, Address,
Telephone number?I
I truly appreciate you taking the time to help me and please forgive my
lack of knowledge in being able to follow your original solution.

Thank you,

HankL
 
A

Al Campagna

Hank,
Sounds like you added a Boolean field named PrintMe (True/False) to
your Restaurant table.

Now, this checking/unchecking of PrintMe is best done using a continous
form, so
you can see as many Restaurants as possible, as you browse and check
PrintMe.
You can do Single Form, but you'll have to...
Find Record and check... find record and check... etc
which can be a bit time consuming.

OK... now make sure that PrintMe is included in the query behind your
form, and
add a check control to the form itself... and bind it (Control Source) to
the PrintMe field,
and name it chkPrintMe.

Just to get this going, use my second suggestion... (the better one for
several reasons).
On a button on your form... using it's OnClick event code...

Refresh
DoCmd.OpenReport "YourRpt", acViewPreview, , "chkPrintMe = True"

Let's see if we can just get to this point, and then we can move on to
other aspects of
this method.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
A

Al Campagna

Hank,
Other than a through Google web search (which yields 100s of hits), and
an Google Access Groups
search (below)...
http://tinyurl.com/ylav9jp
You'll have better luck if you create a new post for this particular
question.
Buried within an unrelated ongoing thread... not too many folks will see
it.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
H

HankL

Hi Al,

Actually I added a new field called PRINTME next to the name of the
restaurant in the table format. In Design View of my table, the data type
is YES/NO. I attempted to put a check mark next to several restaurants and
it accepts the check mark.

I am a little confused by several suggestions you made.

1) Now, this checking/unchecking of PrintMe is best done using a continuous
form, I AM NOT SURE WHAT YOU MEAN BY USING A CONTINUOUS FORM. I assume it
is like using the TABLE.
2) OK... now make sure that PrintMe is included in the query behind your
form, and
add a check control to the form itself... and bind it (Control Source) to
the PrintMe field,
and name it chkPrintMe. THIS NUMBER 2 IS A LITTLE CONFUSING TO ME AS
WELL.

Basically, I am not sure if I should be setting this up in TABLE OR USE A
QUERY?
 
J

John W. Vinson

Hi Al,

Actually I added a new field called PRINTME next to the name of the
restaurant in the table format. In Design View of my table, the data type
is YES/NO. I attempted to put a check mark next to several restaurants and
it accepts the check mark.

I am a little confused by several suggestions you made.

1) Now, this checking/unchecking of PrintMe is best done using a continuous
2) OK... now make sure that PrintMe is included in the query behind your

Basically, I am not sure if I should be setting this up in TABLE OR USE A
QUERY?

Neither.

Tables store data... under the hood, unexposed to user view or interaction.
Queries arrange, select and sort data... under the hood, unexposed to user
view or interaction.

In a professional database, users will essentially NEVER see a table or query
datasheet; all interaction with data should be via a Form.

A form can be in one of three "default views" - Single Form (showing one
record onscreen); Datasheet, showing what looks like a table or a spreadsheet;
or Continuous Form, showing controls like those on a single form (combo boxes,
textboxes, option groups, etc.) repeatedly.

Al's suggesting the latter.
 
H

HankL

Hello John,

Thanks for your response.

I am a novice using Access.

I do have a data base setup for Restaurants.
When I opened Forms it is in a single form view. I went into Design and
clicked on square were both rulers meet. I selected Continuous Forms and
saved it. However when I open the Forms it still shows it in a Single View.
Any suggestions to be able to see it in continuous view?

Thanks in advance for your support.

HankL
 
J

John W. Vinson

When I opened Forms it is in a single form view. I went into Design and
clicked on square were both rulers meet. I selected Continuous Forms and
saved it. However when I open the Forms it still shows it in a Single View.
Any suggestions to be able to see it in continuous view?

You probably need to rearrange the controls on the form. Drag the controls up
to the top edge of the detail area of the form, side by side - you can use one
or two rows if you wish, but if you want to see multiple records onscreen they
should occupy only a small vertical height. Then drag the bottom of the detail
area up to the bottom of the controls. Save the form; when you open it in data
view you should see mulitple records (as many records as fit the recordsource
criteria, anyway).

For an example take a look at the Orders form in the Northwind sample database
- the items ordered are in a continuous form.
 
H

HankL

Hi John,

I attempted to rearrange the controls in Design View of the Form. That did
not change the appearance of the form. However, I now have a scroll bar on
the side of the form and allows me to scroll from one record to another in
alphabetical order. Could this also be considered as a Continuous Form?

If so, could you help me with the instructions as to how to setup a PRINTME
check box on the form so that I can select which record will be printed.

As an example I have 126 records in the Restaurant.mdb. database. Suppose I
only want to print out 8 of this restaurants on a single sheet of paper as a
report.

Also, I setup a dummy .mdb called Test.mdb. This was setup as a continuous
form from a table. The appearance is exactly as you describe in your
suggestion of the Northwest Sample Database. My Test database only has 3
fields.

I truly appreciate your assistance and support as I know it is time
consuming for you. I would really like to get this issue resolved so that I
can print out information from my Restaurant database as I need it.

HankL
 
H

HankL

My forms are now in Continuous Form

I do have a PRINT ME checkbox field included in my Table. However, the
PRINT ME FIELD does not show on my FORM.
Thank you for your continued support,

Hank
 
J

John W. Vinson

My forms are now in Continuous Form

I do have a PRINTME checkbox field included in my TABLE. However, the
PRINTME FIELD does not show on my FORM.

Open the Form in design view.
View its Properties.
Click the ... icon by the Recordsource property and open the recordsource in
query design view.
Add the PRINTME field to the Recordsource.
Use the toolbar or the field list to add a checkbox to the form bound to the
PRINTME field, or if there is a checkbox, set its Control Source property to
the name of the field.
IPlease review the attached and perhaps with these pictures you can help me
setup so that I can print SELECTED restaurants in a report

I have some more .jpg pictures I want to send but I keep getting messages
file is to large

Binary attachments are unwelcome and inappropriate in this text based
newsgroup.
If you could send me your e-mail address I could send those picture directly
via your e-mail

Sorry, I'm an unpaid volunteer donating my time on these newsgroups. To
control my time investment I must limit private email support to paying
customers.
 
J

John W. Vinson

See attachment

Hank, *please do not attach pictures to newsgroup messages*.

This is a TEXT ONLY newsgroup. In point of fact, your pictures provide
absolutely nothing helpful to solving your problem. Posting a few lines of
SQL showing the Recordsource of your form would have taken up 500 bytes
instead of 50000, and provided useful information.
 
H

HankL

Sorry John,

I was not aware that pictures was not permitted in newsgroups. In the
future I will not send any. Thanks for the information.
I misunderstood when the verbiage in your response seemed to me that if you
could see my forms or tables that it would give you a better indication of
my concerns.
Please except my apologies.

Hank
 
A

Al Campagna

Hank,
Have you added the new True/False field named PrintMe to
your form yet? (following John Vinson's instructions)

Even though you have set the form's Default View to Continuous,
because your form is large (vertically), you still may only see one
record at a time, on your screen.

So... for now... you'll need to go to a specific record, check the
PrintMe
to True, go to another record and set PrintMe to True, etc... etc... When
done printing, you'll need to go back and uncheck all the selected
restaurants.
*Don't be concerned by that right now. * We'll get the system working
"manually" to start, and then add conveniences later on.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

HankL said:
Sorry John,

I was not aware that pictures was not permitted in newsgroups. In the
future I will not send any. Thanks for the information.
I misunderstood when the verbiage in your response seemed to me that if
you could see my forms or tables that it would give you a better
indication of my concerns.
Please except my apologies.

Hank
 
H

HankL

John,

At the present time, I have the following setup:

1) A continuous form. I can see two records at one time and when I click on
the arrow it continues to scroll through my database
2) I have a PrintME yes/no checkbox on my table and it is on the form as
well. If I select the checkbox for YES in the table, it also puts a check
in the box on the form
3) I have set up a query
4) I have set up a report

Even if I put a check in various records and I open the report, I see all of
the 126 records rather than only the records with a check in the box

I believe that I am missing a step or filter in the query that will allow me
to only see the records I have checked off.

Please advise.

Thank you,

Hank
 
H

HankL

Hi Al,

This is where I am now
At the present time, I have the following setup:

1) A continuous form. I can see two records at one time and when I click on
the arrow it continues to scroll through my database
2) I have a PrintME yes/no checkbox on my table and it is on the form as
well. If I select the checkbox for YES in the table, it also puts a check
in the box on the form
3) I have set up a query
4) I have set up a report

Even if I put a check in various records and I open the report, I see all of
the 126 records rather than only the records with a check in the box

I believe that I am missing a step or filter in the query that will allow me
to only see the records I have checked off.

Please advise.

Al Campagna said:
Hank,
Have you added the new True/False field named PrintMe to
your form yet? (following John Vinson's instructions)

Even though you have set the form's Default View to Continuous,
because your form is large (vertically), you still may only see one
record at a time, on your screen.

So... for now... you'll need to go to a specific record, check the
PrintMe
to True, go to another record and set PrintMe to True, etc... etc... When
done printing, you'll need to go back and uncheck all the selected
restaurants.
*Don't be concerned by that right now. * We'll get the system working
"manually" to start, and then add conveniences later on.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

John W. Vinson

John,

At the present time, I have the following setup:

1) A continuous form. I can see two records at one time and when I click on
the arrow it continues to scroll through my database
2) I have a PrintME yes/no checkbox on my table and it is on the form as
well. If I select the checkbox for YES in the table, it also puts a check
in the box on the form
3) I have set up a query
4) I have set up a report

Even if I put a check in various records and I open the report, I see all of
the 126 records rather than only the records with a check in the box

I believe that I am missing a step or filter in the query that will allow me
to only see the records I have checked off.

The Query upon which the report is based is probably at fault. It should have
a criterion of True on the PrintME field.

If you're having trouble with the query, open it in design view; select
View... SQL; and copy and paste the SQL text to a message here.
 
H

HankL

That did it. I can't tell you how much I appreciate your patience and
working with me to help setup my being able to select and print a report
just on the restaurants I need to print.
You have really given me a much better understanding of how Access works
using the databases.

John, I do have one more question. Is there a way that I could set up
something that after I print out the report I can select a button to delete
all of the check marks in my table at one time?

Many many thanks,

Hank
 
A

Al Campagna

Hank,
When I spoke of adding "conveniences" once we got the basic
system working... this is one of them.
You might want two buttons on your form...
One button named cmdPrintAll and another named cmdPrintNone

Create two "Update" queries against your Restaurant table.
cmdPrintAll - will run qryPrintAll , that sets the PrintMe for every
Restaurant record to
True.
cmdPrintNone - will run qryPrintNone , that sets the PrintMe for every
Restaurant record to
False.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

HankL said:
That did it. I can't tell you how much I appreciate your patience and
working with me to help setup my being able to select and print a report
just on the restaurants I need to print.
You have really given me a much better understanding of how Access works
using the databases.

John, I do have one more question. Is there a way that I could set up
something that after I print out the report I can select a button to
delete all of the check marks in my table at one time?

Many many thanks,

Hank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top