excluding fields with null values

jeeper987

New member
Local time
Today, 21:58
Joined
Sep 9, 2002
Messages
7
I want to create a report from a query. Many of the records have null values. I would like for the report to exclude the field name and the space where the value would be. In other words, I would like for it to look like there is not a field there. I need this in order to make the report look more organized and easier to read. Please help!!!
 
Go to the query behind your report and put :
Is Not Null in your field that you are talking about. That should get rid of the null values :)
 
If I put "is not null" in the fields, will it not exclude the entire record. I just want to exclude one field out of a record. The report will have name, address, phone, fax, email as the fields. If the person does not have fax number, I do not want the report to put the caption "fax" or a blank space for the null value. The report would then only have name, address, phone, email. I hope I am making sense. thanks
 
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.MyField.Visible=Not IsNull(Me.MyField)
End Sub
 
Works great Rich, Now, is there a way I can apply this to all fields in the report, without having to do it for each field individually.

Thanks
 
also, is there a way to delete the empty space where the field would have been or to move the next visible field up into its place so that there will not be any gaps in the report.
 
This is exactly what I was searching for, so I'm resurrecting this thread. :) Where exactly do I put that code in? I don't see anywhere in the properties of the individual fields that really made sense. I tried in the On Open event of the form detail but I got an error.
 
but surely

if you have a report (effectively a continuous form, printed) each row stands on its own

if you have blanks in a row, you surely cant expect or want to move up an item from the following row

so if there are, in a given row, some fields with values, and some blanks you either want to print the row or not

if you do, then fine, and you can manipulate the blank cells to some extent

but if you dont want to print a row, where any (important) part is blank, then surely the best way to dfo this is to exclude the row in the reports underlying query.
 
I am trying to create a report of the same but I don't understand where to put the following things:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.MyField.Visible=Not IsNull(Me.MyField)
End Sub

If IsNull(me.somefield) then
me.somefield.visible = false
else
me.somefield.visible = true
End if

Could you please help me?
 
Empty Fields

I have created a table with info for chart audit reviews..
It includes fields that are sometimes empty. We need a report that includes all information but will not print the empty fields. I don't know how to do this and I'm not very good at any of this yet. Could you please help me?
 

Users who are viewing this thread

Back
Top Bottom