Solved

Conditional Formatting of Access 2007 Report Header

Posted on 2014-01-29
2
594 Views
Last Modified: 2014-02-03
I am trying to apply a OnFormat condition to a low level report header.  Basically, if the header field does not have a value, I want to suppress display of all the header fields.  The Onload code is:
Private Sub GroupHeader4_Format(Cancel As Integer, FormatCount As Integer)
If (Len(Nz(Me.CAUS_ID, "")) > 0) Then Me.GroupHeader4.Visible = False
   ' If IsNull(Me.CAUS_ID) Then Me.GroupHeader4.Visible = False
  ' If IsEmpty(Me.CAUS_ID) Then Me.GroupHeader4.Visible = False
End Sub
The GroupHeader4 and fields still display.  Note from the commented code that I have tried several ways to detect a null field value, but to no avail.

This is a very large report and there are only about 10% of the records with a CAUS_ID that would have additional data.  Attached is a sample of what the report looks like.

Appreciate any help!

Al
0
Comment
Question by:alvoninfl
2 Comments
 
LVL 20

Accepted Solution

by:
GrahamMandeno earned 500 total points
ID: 39819719
Hello Al

If you want to suppress the printing of the entire header section, then set the Cancel argument to True:

If IsNull(Me.CAUS_ID) Then Cancel = True

If it is possible that Me.CAUS_ID contains a zero-length string (ZLS) rather than a Null, then use this:

If Len( Me.CAUS_ID & "" ) = 0 Then Cancel = True

Best wishes,
Graham Mandeno [Access MVP 1996-2014]
0
 

Author Closing Comment

by:alvoninfl
ID: 39829326
Graham:

I used the second formula and that worked.  Thanks much!

Al
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now