# Database Discussions > Microsoft Access >  Access 2007 - Report View

## ishatoo

Morning...I need some help with my report in ms access 2007. I have 2 different issues:

1. I need to combine records in my report. For example I have 5 employees contact information but instead of having the company name listed only once with the names of all 5 employees listed under it, I have the company listed 5 times with only one employee beneath it. How do I put all names under one heading.

2. I need to be able to add in a simple restriction to allow information like the phone, fax, email, etc. to show only if there is information there.

Any help you can provide will be appreciated. Thanks!

----------


## Allan Murphy

Point 1
GROUP your records by Company Name. You will have a group header with the Company name and the employees will be listed in the details section

Point 2.
If there is no phone number etc. then there will be nothing displayed in the Phone number field in the details section for the employee.

----------


## ishatoo

Good morning Allan,

Thanks for the reply. How do I do the grouping. I have been trying to do it but nothing happens when it is done.

For the phone, etc. I have the tag line that is displayed. The record itself stays blank if there is nothing there. So I need to get rid of the field header when nothing is there and have it displayed when there is. Thanks!

----------


## Allan Murphy

Have look at this link http://www.functionx.com/access/Lesson25.htm. This explains how to group records.

For your phone you will need code on the print format event to check if the field is null then set the field header visible property to FALSE if the field is not null then set the field header visible to TRUE.

----------


## ishatoo

Thanks. That is what I thought for the phone but I was trying to find a solution around that. So is there anyway to do the phone without using the code. The people who will be using the database don't know how to program and if they have to change anything in the future, this will make it more complicated and I will not be there to help. 

Thanks for the link, I will check it out.

----------


## Allan Murphy

I would not worry about displaying or not displaying when there is no phone, as it will be a reminder to the user that a phone number etc. is missing.

----------


## ishatoo

I understand your point. But what I am asking is is there any way for me to hide the label of the field when it is empty without using a program to do it. I am using an if/else statement, but my client has no programming experience.

----------


## Allan Murphy

Using an IF.... ELSE... ENDIF should work. You just need a lit bit of IF ELSE END IF code. If you are still having trouble post your database with the relevant data table(s), queries and report etc. and I will have a look. Please for security purposes do not use actual data use test data for testing.

----------


## ishatoo

Ok. Let me work on it and I will let you know how it went. Thanks!

----------


## ishatoo

I was able to do it on the print view, but how do I remove it from the datasheet view as well.
The code I used is as follow:

If IsNull(Me.[Employee_Email]) Then
Me.Label1.Visible = False
Else
Me.Label1.Visible = True
End If

----------


## ishatoo

Hi Allan,

Can I email you the database? Won't let me do an attachment.

----------


## Allan Murphy

If you want to post it to the forum you will need to Zip the file. Also you can email (zipped copy) it to my gmail address see below.

----------


## ishatoo

I have zipped the files. But it is too big even then. I will email it to you when I get yo work in a couple of hours or so. Thanks.

----------


## ishatoo

Good morning Allan,

I was able to zip the database. Was trying to do a screen shot of the report and that wasn't working when it is zipped. As you will see when you go to the report view my field labels are showing there but not when it is printed. The print out looks fine. So, is it normal for the field labels to show on the report view.

----------


## Allan Murphy

Ishatoo

Your zipped file is blank, have you zipped the correct file? There is no data, reports etc.

----------


## ishatoo

I have. Not sure what happened. I will email them to you tomorrow from work.

----------


## ishatoo

Good morning Allan,

I have e-mailed you the database. Not sure why it is blank here.

Thanks for the help.

----------

