Scaling detail section

J

Jesse Aviles

I'm trying to scale the detail section based on a number
in a field. I wrote a procedure on the On Format event
of the detail section:

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
'Scales detail section to fit boring log
Dim intDepth As Integer

intDepth = Nz(Depth, 0)

If intDepth > 1 Then
Detail.Height = Depth * 300
Else
Detail.Height = 300
End If

End Sub

The Online helps says that during On Format event, the
data in the fields can be accessed but when I open the
report I get the following error and description:

-2147352567
You entered an expression that has no value.

I dont know why is doing this. It looks like Access is
not finding any data in the field (there isn't any at
this moment) and deciding that it should'nt continue.
Another problem I'm facing is that I'm trying to format
the section based on the difference between the values in
the current record and the previous record. However I
can think of a way in which I can make the calculation in
code.

If the first record is 2 and the current record is 8, I
want the section to be six times as high as it was for
the first record.

Jesse Avilés
monk @ coqui . net
 

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