Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing an object independant of report sections 1

Status
Not open for further replies.

EmptyMind

Programmer
Feb 22, 2004
4
GB
I have a report with various sections. It has a background image which is a map whose filename is decided by a query on another form. The report's 'On Load' event code tells the report to look on the form for the filename.

All of the data on the form then prints over the top.

Now I've got a transparent gif called 'PinPoint' which is embedded as an ole object. I want to use it to pinpoint a position on the map. It appears fine on whichever section I place it, but I want to position it relative to the whole page, independant of the sections.

So far I have used:

PinPoint.Left=1000
PinPoint.Top=1500

...But when the object reaches the boundaries of the section it causes an error.

Sooo, how can I stop the object from being bound to the section ?
 
If your pinpoint is just an econ such as an X or some other shape, you might use code in the On Page event of the report:
[blue]
Code:
Private Sub Report_Page()
    'code to place a blue flag on a report
    'the measure is in twips (1/1440 of an inch)
    Me.CurrentX = 1500
    Me.CurrentY = 1000
    Me.FontName = "wingdings"
    Me.FontSize = 24
    Me.ForeColor = vbBlue
    Me.Print Chr(79) 'flag symbol
End Sub
[/blue]

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
That's perfect dhookom, nice one.

I wonder then if it is possible to use the same idea to place an object instead of text? Perhaps you could create the object from within the on_page code ?

Flag works great though, thanks.

;o)
 
Empty,
I doubt that it is possible to create an object on a report in any view other than design view. I like the debug.print method since it takes very little resources and can be done without going to design view.

I will often use the Line method rather than cluttering my design view with "objects". For instance, if I want a line at the bottom of my Page Header:
[blue]
Code:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
    Me.Line (0, Me.PageHeaderSection.Height)-Step(Me.Width, 0)
End Sub
[/blue]
This will automatically draw the line from left to right at the bottom of the page header.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top