Ho do I shift empty cells up in an access report

G

GBA

In my contact data base, I have an unequal number of data for each contact,
some have 3 phone numbers some have up to 8 etc. I would like to print out a
directory (phone book) in which records do only show fields that are
populated. In other words, one record may only include 3 lines others may
include 9 lines but I do not want to display and print a fixed number of
lines, only the ones that are populated.
 
M

Marshall Barton

GBA said:
In my contact data base, I have an unequal number of data for each contact,
some have 3 phone numbers some have up to 8 etc. I would like to print out a
directory (phone book) in which records do only show fields that are
populated. In other words, one record may only include 3 lines others may
include 9 lines but I do not want to display and print a fixed number of
lines, only the ones that are populated.


Depends on what the report's record source records look
like. If you would post some sample records and how you
want their fields to appear in the report, most likely
someone can help figure out how.
 
K

KARL DEWEY

Sounds like you have a spreadsheet with up to 8 fields for phone numbers.
Normalize your data using a union query.
SELECT FName, LName, Phone1
FROM Yourtable
UNION ALL SELECT FName, LName, Phone2
FROM Yourtable
WHERE Phone2 Is Not Null
UNION ALL SELECT FName, LName, Phone3
FROM Yourtable
WHERE Phone3 Is Not Null
.........
UNION ALL SELECT FName, LName, Phone8
FROM Yourtable
WHERE Phone8 Is Not Null;

In your report group on FName and LName.
 

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