Error on print

G

Guest

hi

i encounter this error message:

"There isn't enough memory to perform this operation. Close unneeded
programs and try the operation again."

i preview my report and when i print it that error message appear.
i noticed that my sub report located at page footer i have a code here and
this my code.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)

[PageFootnote 01].Visible = False
[PageFootnote 02].Visible = False
[PageFootnote 03].Visible = False
[PageFootnote 04].Visible = False
[PageFootnote 05].Visible = False
[PageFootnote 06].Visible = False
[PageFootnote 07].Visible = False
[PageFootnote 08].Visible = False
[PageFootnote 09].Visible = False

Select Case [Page]
Case 1: [PageFootnote 01].Visible = True
Case 2: [PageFootnote 02].Visible = True
Case 3: [PageFootnote 03].Visible = True
Case 4: [PageFootnote 04].Visible = True
Case 5: [PageFootnote 05].Visible = True
Case 6: [PageFootnote 06].Visible = True
Case 7: [PageFootnote 07].Visible = True
Case 8: [PageFootnote 08].Visible = True
Case 9: [PageFootnote 09].Visible = True
End Select

End Sub

can you help me with this?

thanks
chad
 
A

Allen Browne

Chad, the error may not be associate with the code. To test that idea, try
temporarily removing the code, and see if it still occurs. Particularly if
there are lots of other reports open, subreport, embedded objects (like
graphs), it may be a memory issue. It could also be a faulty driver (video
card or printer.)

I didn't quite follow the code, but I think you want to display these 9
controls only for the first 9 pages of the report (not for pages 10
onwards)? If so, you could try this aircode. The main difference is that it
only changes the Visible property once (when you get to page 10) instead of
turning it on and off again every page.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Dim bShow As Boolean
Dim i As Integer
bShow = (Me.Page < 10)
If Me.[PageFootnote 01].Visible <> bShow Then
For i = 1 to 9
Me("[PageFootnote " & Format(i, "00\]")).Visible = bShow
End If
End If
End If
 

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