Using the Clipboard to Copy Controls to Another Form

Access's capability of copying controls and their properties to the Windows Clipboard lets you create controls on one form and copy them to another. You can copy the controls in the header of a previously designed form to a new form and edit the content as necessary. The form that contains the controls to be copied need not be in the same database as the destination form in which the copy is pasted. This feature lets you create a library of standard controls in a dedicated form that is used only for holding standard controls. If your library includes bound controls, you can copy them to the form, and then change the field or column to which they're bound.

The Date/Time calculated text box is a candidate to add to Chapter 14's frmHRActions form. You might want to add a Time/Date text box to the Form Header or Detail section of all your transaction forms. To add the Date/Time control to the frmHRActions form, assuming both forms are in the same database, do the following:

  1. graphics/design_view.gif With the frmHRActionEntry form open, click the Design View button, and select the Date/Time control and its label by clicking the text box.

  2. Press Ctrl+C to copy the selected control(s) to the Clipboard.

  3. Press Alt+W, 1 and open the frmHRActions form from the Database window in Design view.

  4. Click the Detail section selection bar, and press Ctrl+V. A copy of the control appears in the upper-left corner of the Detail section.

  5. Position the mouse pointer over the copied text box so that the pointer becomes a hand symbol.

  6. Hold down the mouse button and drag the text box and its label to a position to the right of the Title label and text box.

  7. graphics/subform.gif Click Form view to display the modified frmHRActions form (see Figure 15.21).

  8. Return to Form Design view, click the Save button to save your changes, and close the frmHRActions form.

graphics/troubleshooting.gif

If you receive an error message when the focus moves to controls you've copied to another form, see "Error Messages on Copied Controls" in "Troubleshooting" near the end of this chapter.


Figure 15.21. Copying a previously formatted control and its label from one form to another saves design time.

graphics/15fig21.gif



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net