Please help resizing Bound Object Frame

G

Guest

I have a Bound Object Frame called OLEBound34 sourcing an onject from
ReportImage in table FAQ. Each record witn a ReportImage OLE also has two
sizing fields, ReportImageWidth and ReportImageHeight. I would like to size
the Bound Object Frame based on the values in ReportImageWidth and
ReportImageHeight.

I have gotten this far:

Private Sub Report_Activate()

OLEBound34.Width = ReportImageWidth
OLEBound34.Height = ReportImageHeight

End Sub

However, this is not capturing the values in ReportImageWidth or
ReportImageHeight. What else do I need to do to make this work?

Thanks,

Peter
 
S

Stephen Lebans

Place your code in the Format event of the Section containing your bound OLE
Frame control.

--

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

Guest

Thanks for your reply.

When I click on Build Event for the Detail section and enter

OLEBound34.Width = ReportImageWidth

The Expression Builder changes the code to

=[OLEBound34].[Width]=[ReportImageWidth]

and throws a Type misatch error.

The values in ReportImageWidth are numbers.

Thanks, Peter
 
G

Guest

Stephen, I can't get the Expression Builder to accept

OLEBound34.Width = ReportImageWidth

What am I doing wrong?

Peter

sduraybito said:
Thanks for your reply.

When I click on Build Event for the Detail section and enter

OLEBound34.Width = ReportImageWidth

The Expression Builder changes the code to

=[OLEBound34].[Width]=[ReportImageWidth]

and throws a Type misatch error.

The values in ReportImageWidth are numbers.

Thanks, Peter

Stephen Lebans said:
Place your code in the Format event of the Section containing your bound OLE
Frame control.

--

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

Stephen Lebans

You want to use the Code Builder not the Expression Builder

Bring up the Detail section's Properties dialog.
Click on the Event Tab
For the On Format property select the Drop Down arrow to hightlight [Event
Procedure].
Click on the Ellipse(...) to the right of the Drop Down arrow and it should
put you into the VB IDE.
You will see two lines of code like:

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

End Sub

Modify it to look like this:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
OLEBound34.Width = ReportImageWidth
End Sub

--

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


sduraybito said:
Stephen, I can't get the Expression Builder to accept

OLEBound34.Width = ReportImageWidth

What am I doing wrong?

Peter

sduraybito said:
Thanks for your reply.

When I click on Build Event for the Detail section and enter

OLEBound34.Width = ReportImageWidth

The Expression Builder changes the code to

=[OLEBound34].[Width]=[ReportImageWidth]

and throws a Type misatch error.

The values in ReportImageWidth are numbers.

Thanks, Peter

Stephen Lebans said:
Place your code in the Format event of the Section containing your
bound OLE
Frame control.

--

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


I have a Bound Object Frame called OLEBound34 sourcing an onject from
ReportImage in table FAQ. Each record witn a ReportImage OLE also has
two
sizing fields, ReportImageWidth and ReportImageHeight. I would like
to
size
the Bound Object Frame based on the values in ReportImageWidth and
ReportImageHeight.

I have gotten this far:

Private Sub Report_Activate()

OLEBound34.Width = ReportImageWidth
OLEBound34.Height = ReportImageHeight

End Sub

However, this is not capturing the values in ReportImageWidth or
ReportImageHeight. What else do I need to do to make this work?

Thanks,

Peter
 

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