Select Individual Records

J

jdb

I am a novice user, and know how to do simple queries.

I have a table of 1,500 records, and would like the ability to select
individual records for a report. Say, for example, I want to print labels
for records 1, 432, 765, 134, and 1487. Those records may have nothing in
common to do a query.

Is there a way to do this? In my mind, their should be a way to create a
query (or table or form or report) that shows all the records, allows you to
highlight the records you want, then saves the results.

Thanks
 
K

Kristibaer

Hi Joe:

This might sound a little on the clunky side, but in the design view of the
query in the column the data you need is, you can write criteria to select a
single record or multiple records using the following expressions in the
criteria field of that record:

Like "*432*"

(with or without the asteriks-used beefore and after will return all records
with the data between them)

If you have more than one reocrd, use the same expression but add on as
follows:

Like "*1*" or like "*432*" or like "*765*" or like "*134*" ...and so on.

If you have a range of records, you can also use greater/less than
"1" And <"765"

Hope that helps.

Kristi
 
M

MGFoster

jdb said:
I am a novice user, and know how to do simple queries.

I have a table of 1,500 records, and would like the ability to select
individual records for a report. Say, for example, I want to print labels
for records 1, 432, 765, 134, and 1487. Those records may have nothing in
common to do a query.

Is there a way to do this? In my mind, their should be a way to create a
query (or table or form or report) that shows all the records, allows you to
highlight the records you want, then saves the results.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yes, there is a way to do this. It takes some VBA coding.

If you want to just run labels from a form you can put a command button
on the form that, when clicked, runs a label report that reads the data
from the form and uses it as its criteria. (Hint: Me.Filter = RecordID
= Forms!frmData!txtRecordID Me.FilterOn=True). This is a one-at-a
time method.

For multiple records I set up the report to open a criteria form that
puts the possible records in a ListBox. Sometimes the criteria form has
it's own criteria that the user has to fill-in to display those records
in the ListBox. This allows the user to select which records they want
in the Report. When the user has finished selecting possible records
from the ListBox they click the Run command button I've conveniently
placed on the criteria form. The report then runs using only the
records the user has selected. The report reads the data from the
criteria form's ListBox, sets up its Filter, or changes its
RecordSource, and displays the results.

There are resources on the Web that describe in more detail how to do
this. Also, the Goggle groups archive has this described many times in
many posts. Try searching there for the code. If all else fails there
were the famous _Access Developer's # Handbook_ by K.Getz, et. al.
which I believe are out of print. They used to have a web site, perhaps
it still exists.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBR74Ei4echKqOuFEgEQK6ewCeKLCNtjFrV5y6XDzh7DGoC3B/RiMAn3LJ
PZzprNox6e7qsR5VaS9etlgX
=hN+5
-----END PGP SIGNATURE-----
 
J

John Spencer

Another option is to add a yes/no field to your table and then check the
box when you want to select specific records. This only works well when
your database is a single-user database.

You can enhance this a little bit by having a query that clears all the
checked boxes.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

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