Manipulating design objects on forms and reports

Once you have placed fields, table frames, notebooks, graphics, and other design objects onto a form or report, you can manipulate them. You must be in design mode to manipulate design objects.

In this section, you'll learn about

  naming design objects
  
  selecting and deselecting design objects
  
  viewing design objects
  
  sizing and shaping design objects
  
  moving and aligning design objects
  
  duplicating, grouping, and stacking design objects
  
  placing scroll bars on design objects
  
  containing design objects
  
  changing design object and design document properties
  
  controlling expanded and pushed objects in reports
  
For more information about manipulating design objects, see "Reference: Manipulating design objects on forms and reports."

Naming design objects

When you add a design object to a form, a default name is given to the object; however, you can rename the object. The name of a selected object displays on the status bar and in some error messages. Naming design objects can help you determine which object is selected in a complicated design.

To rename a design object

1	Right-click an object, and click Properties.

2	Click the General tab.

3	Type the name for the object in the Name of object box.

Note

  Object names can be up to 31 characters long and cannot begin with a number or symbol.
  
Selecting and deselecting design objects

By default, you can select any object on a form or report in a design window. You can also deselect a design object. Occasionally you may want to set an object so that it cannot be moved or its shape cannot be changed. You can achieve this by preventing the object from being selected.

To select a design object

To select	Do the following

A field	Click the field.

To select specific text	Click the text object to select it. Click inside the text to place the cursor, and drag to select the text.

To select multiple objects	Hold down SHIFT, and click the objects.

To select adjacent objects	Hold down SHIFT, and drag to surround the objects with a box.

Note

  When an object is selected, handles display around the object and the name of the object displays on the status bar in the lower-right of the screen.
  
To deselect a design object

  Hold down SHIFT, and click an object.
  
To prevent an object from being selected

1	Right-click an object, and click Properties.

2	Click the Design tab.

3	Disable the Selectable check box.

Note

  When you prevent an object from being selected, you can select any object it contains, but you cannot select the container object. This means you cannot move the object or perform any other action that requires the object to be selected.
  
Tip

  You can still change an the properties of an object that can't be selected by right-clicking the object and clicking Properties.
  
Viewing design objects

You can change the way in which design objects are viewed in a form or report. You can choose to display design objects with frames. If you do then, the frame's properties can be changed. You can also display outlines of objects when you are moving or resizing them. You can display the size and screen position of a design object on the status bar, and you can display the design object size and position in the status bar.

To display frames for a design object

1	Click Format  Design setup.

2	Enable the Frame objects check box.

Notes

  When you enable the Frame objects check box, objects without a clear frame or outline are outlined by dotted lines to help you see them.
  
  If you disable the Frame objects check box, a frame displays only if you have changed the object's frame properties (the frame's color, style, or thickness).
  
To change a frame's properties

1	Right-click the object, and click Properties.

2	Click the Frame tab.

3	Choose from the following attributes:

  Frame color-changes the frame's color
  
  Frame style-changes the frame's style
  
  Frame thickness-changes the frame's thickness
  
Tip

  Some line and frame styles can only be applied when the line or frame is set to the thinnest choice. The selections made will default to the required thickness or frame style when the Apply button is clicked.
  
Displaying outlines for design objects while moving or resizing

1	Click Format  Design setup.

2	Enable the Outlined move/resize check box.

Note

  When you disable the Outlined move/resize check box, the object is displayed whenever you move or resize it. Most moving and resizing operations are faster when you enable the option because the screen image is not redrawn until the operation is complete. However, some operations are clearer when you can see what is happening throughout the operation.
  
To display design object size and position on the status bar

  Click View  Size and position.
  
The right end of the status bar displays the position (based on an XY axis) and size of the selected object.

Note

  When you move or resize an object, the left side of the status bar displays the name of which object is moving and what its position is. This can help you move or resize objects more accurately. When you finish moving or resizing an object, the size and position values displayed in the status bar are updated.
  
Sizing and shaping design objects

You can change the size and shape of a design object, as well as the size and spacing of an object relative to other design objects. You can make a field object expand or contract in the design window when its contents get larger or smaller. You can constrain objects so that they take on fixed shapes, and stretch them so that they take on any shapes that suits your needs. You can also change the magnification of a graphic or OLE field.

To change the size or shape of a design object

1	Click a design object.

2	Click and drag any of the eight handles that surround the object.

To adjust the size and spacing of multiple design objects

1	Hold down SHIFT, and select the objects.

2	Click Format  Size, then select one or more of the following:

  Minimum width-resizes all objects to the width of the narrowest object
  
  Maximum width-resizes all objects to the width of the widest object
  
  Minimum height-resizes all objects to the height of the shortest object
  
  Maximum height-resizes all objects to the height of the tallest object
  
To size a field object

1	Right-click the field object, and click Properties.

2	Click the Design tab.

3	Enable the Size to fit check box.

Tip

  If an OLE object or bitmapped image does not resize with handles, disable the Size to fit check box. 
  
To constrain an object

1	Click the object.

2	Hold down SHIFT, and drag a corner handle.

Note

  When you constrain an object, all objects except lines maintain their current proportions. Lines are forced to be horizontal, vertical, or at a 45-degree angle.
  
To change the magnification of a graphic or OLE field

1	Right-click the graphic or OLE field, and click Properties.

2	Click the Magnification tab.

3	Click one of the following:

  25% or 50%-shrinks the displayed object
  
  100%-displays the object in its original size
  
  200% or 400%-magnifies the displayed object
  
  Best fit-shrinks the object to fit in the field while retaining the proportions of the original object
  
Tip

  For fastest performance, display graphic and OLE objects at 100%. Best fit usually provides the slowest performance.
  
Moving and aligning design objects

You can move an object to any position on the form or report. An object can also be aligned relative to another and the spacing between them can be adjusted. You can snap design objects to the grid. When a design object snaps to the grid, its top-left corner is moved to the nearest intersection of gridlines. You can also pin an object to a form or report, which prevents it from being accidentally moved with the mouse.

To move a design object

1	Select the object.

2	Drag the object to its new position.

Tips

  When you move an object, holding down SHIFT while you drag forces the object to move only horizontally or vertically. If you move the mouse along a diagonal line that is flatter than 45 degrees, the object moves horizontally; otherwise, the object moves vertically.
  
  You can also use the Arrow keys to move the object to its new position.
  
To align design objects

1	Hold down SHIFT, and select the objects.

2	Click Format  Alignment, and choose one of the following:

  Align left-aligns the left side of each object with the left side of the left-most object
  
  Align center-aligns the midpoints of the objects vertically
  
  Align right-aligns the right side of each object with the right side of the right-most object
  
  Align top-aligns the top of each object with the top of the highest object
  
  Align middle-aligns the midpoints of the objects horizontally
  
  Align bottom-aligns the bottom of each object with the bottom of the lowest object
  
To adjust the spacing between design objects

1	Hold down SHIFT, and select the objects.

2	Click FormatSpacing, and choose one of the following:

  Horizontal-adjusts the horizontal spacing between the objects
  
  Vertical-adjusts the vertical spacing between the objects
  
To snap an object to the grid

1	Select a design abject.

2	Click Format  Snap to grid.

Notes

  When a design object snaps to the grid, its top-left corner is moved to the nearest intersection of gridlines. If an object cannot move to that position (because it is blocked by the edge of its container, for example), it will get as close as possible.
  
  Objects never leave their containers to align; the objects move as far as they can in the indicated direction. Aligning objects does not break the container relationship.
  
To pin a design object on a form or report

1	Right-click the object, and click Properties.

2	Click the Design tab.

3	Enable one or both of the following check boxes:

  Pin horizontal-allows the object to be moved up or down, but not left or right
  
  Pin vertical-allows the object to be moved left or right, but not up or down
  
Tip

  To prevent an object from moving in any direction, enable both Pin horizontal and Pin vertical.
  
Duplicating, grouping, and stacking design objects

You can duplicate any design object on the form or report. You can also group design objects together so they behave as one object during certain operations. Groups act like containers, except they contain only the objects you selected. Groups are useful if you need some, but not all, objects to act like as a single unit. Grouped objects can also be separated. Objects in a design document can be stacked on top of or underneath other objects.

To duplicate a design object

1	Select the object.

2	Click Edit  Duplicate.

A copy of the selected object is placed just below the original.

Notes

  You can only duplicate objects within the same design window, not from one window to another.
  
  If you duplicate a table or multi-record object, the new object is created as an undefined table that has the same table-level properties as the original (for example color and column positions), but the table fields are replaced by undefined fields.
  
To group design objects

1	Hold down SHIFT, and select the objects.

2	Click Format  Group.

Note

  Groups can exist within other groups. You can select a group and select other design objects, then group all of them together. The first group remains intact within the larger group.
  
To separate grouped design objects

1	Hold down SHIFT, and select the grouped objects.

2	Click Format  Ungroup.

To stack design objects

1	Select an object.

2	Click Format  Order, and choose one of the following:

  Bring to front  moves the selected object in front of all other objects
  
  Send to back  moves the selected object behind all other objects
  
Notes

  Bring to front and Send to back change the order only within a container
  
  If you select a group of objects and click Bring to front, the internal ordering of the group is maintained and the entire group is brought to the front.
  
Placing scroll bars on design objects

You can add either horizontal or vertical scroll bars to objects in design documents. The behavior of scroll bars and the objects they can be added to depends on whether you are working with a form or report. For more information about scroll bars in forms or reports, see "Scroll bars in forms", and "Scroll bars in reports."

To place a scroll bar on an object

1	Right-click the object, and click Properties.

2	Click the General tab.

3	In the Scroll bar area, enable one of the following check boxes:

  Horizontal-places a scroll bar along the bottom of the object
  
  Vertical-places a scroll bar along the right side of the object
  
  Wide-makes the scrollbar wider than the default
  
Containing design objects

A contained object is a design object that exists completely within the borders of another object (the container). Contained objects move when you move their containers and are deleted when you delete their containers. However, if you first break the container relationship, you can then delete the container without deleting its contained objects.

To create a contained design object

1	Select the container object.

2	Right-click the object, and click Properties.

3	Click the Design tab.

4	Enable the Contain objects check box.

5	Place the object you want to contain inside the container object by doing one of the following:

  Create a new object within the borders of the container object.
  
  Move an existing object completely within the borders of another object.
  
  Move or resize a container around an object.
  
  Paste an object into another object.
  
Note

  The contained object must be completely within the borders of the container object. If the container object has a frame, the contained object must be completely within the frame.
  
Tips

  It may be difficult to contain one object in another if Format  Snap to grid is enabled, because both objects might try to align on the same grid line. In this case, resize one or both of the objects so they snap to different grid lines, or turn off Snap to grid. For more information about Snap to grid, see "To snap an object to the grid."
  
  If you disable the Contain objects check box for an object, the object will move independently of any objects within its boundaries.
  
To delete a contained design object

1	Select the contained object.

2	Click Edit  Delete.

Notes

  Deleting a container deletes any objects in the container, but, deleting a contained object does not affect its container.
  
  If you first break the container relationship, you can delete a container, but not its contained objects. For more information about breaking a container relationship, see: "To break a container relationship."
  
To break a container relationship

1	Right-click the container object, and click Properties. 

2	Click the Design tab.

3	Disable the Contain objects check box.

Note

  After you have broken a container relationship, you can delete a container without affecting its contained objects. For more information about deleting contained objects, see "To delete a contained design object."
  
Changing design object and design document properties

You can change the properties of any design object on your a or report. If you have many objects on a form or report, you can choose to change their properties simultaneously, rather than changing them separately. You can also change the properties of the design document, and you can change the properties of both the design document and the objects within the design document at the same time.

To change the properties of a design object

1	Select a design object.

2	Right-click the object, and click Properties.

3	Change the properties on the appropriate property pages.

Note

  Your property choices are applied to all objects for which the property is valid and to any objects contained by the selected object.
  
To change properties of multiple objects simultaneously

1	Hold down SHIFT, and select the objects.

2	Right-click one of the objects, and select Properties.

3	Change any properties.

Note

  Your property choices apply to all objects for which the property is valid, and to any objects contained by a selected object.
  
Tip

  If you select a contained object, the changes are applied to each object within the contained object. To change properties for the container only, select the container, right-click, and click Properties. For more information about contained objects, see "Containing design objects."
  
To change the properties of the design document

1	Press ESC until the lower-right corner of the status bar indicates that the form or report is selected.

2	Press F6, and click Properties.

3	Change any properties.

To change the properties of the design document and all its objects

1	Press ESC until the lower-right corner of the status bar indicates that the form or report is selected.

2	Press SHIFT + F6, and click Properties.

Controlling expanded and pushed objects in reports

When you preview or print a report, some objects fill with data, causing them to expand or contract. For example, a table object may grow vertically to display all its records, or a graphic object may expand to show all of a picture. This change in size can cause other objects to be pushed or pulled across the report.

To maintain the alignment of multiple objects on a report as they are pushed or pulled by expanding or contracting objects, you can place lines to separate them. These lines will be hidden at runtime. You can prevent objects from being pushed or pulled by pinning them to the report at runtime, or you can choose to prevent the expanding and contracting of objects.

To hide a line used to control pushed objects

1	Right-click a line, and click Properties.

2	Click the Run time tab.

3	In the Run mode area, disable the Visible check box.

Notes

  You must first have a line on your report to perform this procedure. For more information about placing a line on a report, see "To add a straight line to a form or report."
  
  You will be able to see the line when you design the report, but not when you view or print the data.
  
Tip

  For examples detailing how to control pushed or pulled objects, see the following examples:
  
  Example of preventing pushing and pulling
  
  Example of invisible lines aligning pushed objects
  
To pin design objects on a report at run time

1	Right-click an object, and click Properties.

2	Click the Run time tab.

3	In the Run mode area, enable any of the following check boxes:

  Pin horizontal-prevents the object from moving left or right
  
  Pin vertical-prevents the object from moving up or down
  
Notes

  An object that expands can hide a pinned object.
  
  For more information about Pin horizontal, see "Example of preventing pushing and pulling."
  
To prevent expanding and contracting objects

1	Right-click an object, and click Properties.

2	Click the Run time tab.

3	Disable the following check boxes:

  Fit width
  
  Fit height
  
Note

  For more information about the Fit width and Fit height properties, see "Fit height property" and "Fit width property".
  
Tip

  Disabling a object's Fit width and Fit height check boxes in a report can speed up previewing.
  
Reference: Manipulating design objects on forms and reports

This topic contains reference information pertaining to manipulating design objects on forms and reports.

Scroll bars in forms

When you place a scroll bar on an object in a form design window, the scroll bar displays when the form runs, which allows the user to scroll through the object. You can add scroll bars to the following object types:

  text objects (vertical scroll bar only)
  
  graphic objects
  
  OLE objects
  
  field objects
  
  table frames (a horizontal scroll bar is automatically placed along the bottom of a table frame if you define a table that is too large to fit on the page when the Size to fit check box is enabled on the Design page of the Properties dialog box)
  
  multi-record objects
  
  notebook objects 
  
  form pages
  
  report pages in the design window
  
Scroll bars in reports

Some objects in reports can have scroll bars, but the scroll bars do not display when the report is being previewed or printed. You use the scroll bars in a report design window to view text and graphics that don't fit in their allocated space. At run time, the object expands to fit its contents and the scroll bars disappear. When the object expands, it may push other objects that are beneath it or to the right.

Text objects

When you work with a text object in the report design window, you can place a vertical scroll bar along its right side. You can then enter large amounts of text in the design window without resizing the text object.

When you run the report, the text object can be expanded vertically down the page to display its entire contents. The expansion of the text object may push objects that are beneath the text object. You can control the effects of object expansion by setting run time properties on the Run Time page of the Properties dialog box.

Graphic and OLE objects

If you resize a graphic or OLE object container to be smaller than its contents, you can place scroll bars across its bottom or along its right side. Use the scroll bars to view different sections of the object. Use this technique to crop the object to show only part of it.

Tables and multi-record objects

You can place a horizontal scroll bar on a table frame in a report to allow you to scroll through the table frame in the report design window. When you run the report, the scroll bar is deleted and expands the table frame to display its entire contents. The expansion may push objects that are beneath the table frame.

Example of preventing pushing and pulling

When you run or print a report, some objects fill with data. This may cause the objects to grow or shrink. As objects resize, they push or pull other objects on the page.

For example, suppose you place the Name field from Customer in a report. When you are working in the report design window, the field object is always the same size. When you run the report, the values displayed in the field object differ in size and, by default, the field object grows or shrinks to fit the data.

Now suppose you have a graphic object to the right of the Name field. The following figure shows how the graphic can be pushed or pulled by the Name field.

The size of the data in the Name field causes the field object to expand or contract. When the field expands, it pushes the graphic to the right. When it contracts, it pulls the graphic to the left.

The following figure shows how the pinning of the graphic at run time affects the report.

When you enable the Pin horizontal check box  the size of the data in the Name field does not affect the graphic. Because it is pinned, the graphic is neither pushed nor pulled as the data changes.

One possible consequence of pinning an object, which might otherwise be pushed, is that an object that expands can obscure a pinned object.

Example of invisible lines aligning pushed objects

When you preview or print a report, some objects fill with data. This may cause the objects to grow or shrink. As objects resize, they push or pull other objects on the page.

Suppose you align objects in the report design window and find that one of them is pushed by another object when you run the report. You can use invisible lines or boxes to group and control the alignment of multiple pushed objects, or you can select the objects and group them by clicking Format  Group.

For example, suppose you had objects like this on the report design:

When you run the report, the Vendor Name field pushes or pulls the box, but not the ellipse.

If, in the report design window, you place a vertical line between the field and the other two objects, the field that expands pushes the line, which subsequently pushes both objects.

If you don't want to see the line, right-click the line and click Properties. On the Run time page of the Properties dialog box, enable the Invisible check box.

You can achieve the same results by grouping the box and the ellipse so they move together.






