Report Object Coordinates


B

Brian

I have seen solutions to graphics on reports questions that
have code that will draw lines and circles, locating them
on the report with coordinates. Is there functionality
that will allow me to see the coordinates of an object in
the design mode of a report, or do I simply keep guessing
and narrow the location down? Thanks.
 
Ad

Advertisements

S

Steve Schapel

Brian,

If you select a control in the report design, and look at tis
Properties, you will see its Left, Top, Width, and Height properties.
To set values in code for these dimesnsions, you need to use the Twips
unit. To convert centimetres to twips, multiply by 567. To convert
inches to twips, multiply by ... something else.
 
M

Marshall Barton

Brian said:
I have seen solutions to graphics on reports questions that
have code that will draw lines and circles, locating them
on the report with coordinates. Is there functionality
that will allow me to see the coordinates of an object in
the design mode of a report, or do I simply keep guessing
and narrow the location down?
The coordinates of your controls are specified in their Top,
Height, Left and Width properties. You specify those
property values in your favorite units (inch or cm), but
internally, Access always uses twips (1440 per inch).

For example, to draw an oval around a text box, it is
easiest to draw it relative to the control's properties.

Me.Circle (textbox.Left + textbox.Width / 2, textbox.Top +
textbox.Height / 2), textbox.Width / 2 + 40, , , , 0.5

where the 40 is the only guesswork you need.

Note that Print, Line and Circle are all able to use
numerous report property settings (CurrentX/Y, line width,
font, scale, etc) so you could make all kinds of adjustments
if you so desire.
 
Ad

Advertisements


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