can shrink, can grow ole field

J

Jennifer

Hello to anybody who can help! I have created a ole
field that is linked to a bitmap. Is there a way to
shrink an OLD field? I have blank pages or pages with
the border from the field (I removed the border so now
the pages are blank) some of the fields contain null
value as I also have a memo field in the report. Just
two fields, one is a meme with data (no problems there)
and the other is a ole field which is linked to a map
which is supported in a bitmap. If I don't have a map to
accompany the memo-data field, the following page is
completely blank. Any help would be greatly apprecaited!
 
S

SA

Jen:

There's no way to change the size of an OLE field at run time in a report;
they are static sized. However, based on your description there's a way to
work around this issue.

If you can, create a group footer based on some key value that would be
unique to each group of data. Put the OLE control and Memo field in that
section and set the section's property for ForceNewPage to AfterSection.

Then, in the On Print Event of the group footer, add code like this:

If IsNull(Me!MyOLEFieldName) And IsNull(Me!MyMemoFieldName) Then
Me.PrintSection = False
Me.MoveLayout = True
Me.NextRecord = True
End if
 
S

Stephen Lebans

Steve I have mentioned this before but perhaps you missed my post.

You can certainly resize an OLE Frame control or even an ActiveX control
at runtime for a Form or a report. If you convert the sample Form to a
Report in the AutosizeOLE solution on my site you will be able to verify
this. THe real issue is that once you programmatically resize any
control, the Detail section will never shrink smaller than the tallest
value your resizing forced the section to become.
With A2K or higher this issue has been resolved in that now it is
allowed to resize the Detail section from within the Format event.

Back to the OP's issue. Since they are working with a fixed size OLE
Frame control and do not need autosizing, I would simply set the
control's Visible prop to false in the Format event when the control
contains no data.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' Set the OLE Frame control's Visible prop to NO if empty.

If IsNull(Me.OLEBoundAutosize.Value) Then
Me.OLEBoundAutosize.Visible = False
Else
Me.OLEBoundAutosize.Visible = True
End If

End Sub


Just my $.02
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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