Error Handling for Report

R

roccogrand

In my proposal database I have six Calendar objects (positioned 3 across and
2 down) in one my reports. Three of the calendars should not appear in the
reports if their data sources are null.

I have inserted the code below to display white boxes on top of the
calendars when the data sources are empty. Yesterday the module crashed
(probably a memory issue) and so I need error checking to handle this
situation.

What kind of error checking do I need?


Private Sub Report_Load()
If IsNull(Me.ProposalShip) = False Then
Box87.Visible = False
Else
Box87.Visible = True
End If

If IsNull(Me.ProposalRed) = False Then
Box88.Visible = False
Else
Box88.Visible = True
End If

If IsNull(Me.ProposalGold) = False Then
Box95.Visible = False
Else
Box95.Visible = True
End If
End Sub

Thanks,

David
 
A

Allen Browne

Use the Format event of the section that contains the boxes instead of the
report's Load event.

A report may have more than one record. If so, the value of fields such as
ProposalShip may be different in different records. Report_Load won't handle
these cases.
 
R

roccogrand

Thanks Allen,

After using the boxes to hide the calendars I thought that applying
..Visible directly to the calendars would work even better. Instead I found
that firing this event totally confuses the ActiveX controls -- the numbers
and text on the face of the calendars disappear completely. In addition, the
calendars with the events move down in the report about half an inch. This
happens on both my development and production machines.

Can you tell me why this happens or is this the problem that Access experts
all know about?

David
 
A

Allen Browne

Someone else may be able to comment.

I don't have experience with ActiveX controls, as I don't trust them
(versioning problems.) I tend to use a subreport instead.
 

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