ObjectPalette Property [Access 2003 VBA Language Reference]

The ObjectPalette property specifies the palette in the application used to create:

  • An OLE object contained in a bound object frame, chart, or unbound object frame.

  • A bitmap or other graphic that is loaded into a command button, image control, or toggle button by using the Picture property.

expression.ObjectPalette

expression Required. An expression that returns one of the objects in the Applies To list.

Remarks

Microsoft Access sets the value of the ObjectPalette property to a String data type containing the palette information. You can use this setting to set the value of the PaintPalette property for a form or report.

For the following objects, views, and controls, the ObjectPalette property setting is read-only. This property setting is unavailable for these controls in other views.

Object View Control
Forms Form Design view and Form view Command button, chart, image control, toggle button, and unbound object frame.
Form view Bound object frame.
Reports Report Design view Command button, chart, image control, toggle button, and unbound object frame. This property setting is unavailable for a bound object frame in all views on a report.

Note  You can use the setting of this property only in a macro or Visual Basic .

If the application associated with the OLE object, bitmap, or other graphic doesn't have an associated palette, the ObjectPalette property is set to an zero-length string.

The setting of the ObjectPalette property makes the palette of the application associated with the OLE object, bitmap, or other graphic contained in a control available to the PaintPalette property of a form or report. For example, to make the palette used in Microsoft Graph available when you're designing a form in Microsoft Access, you set the form's PaintPalette property to the ObjectPalette value of an existing chart control.

Note   Windows can have only one color palette active at a time. Microsoft Access allows you to have multiple graphics on a form, each using a different color palette. The PaintPalette and PaletteSource properties let you specify which color palette a form should use when displaying graphics.

Example

The following example sets the PaintPalette property of the Seascape form to the ObjectPalette property of the Ocean control on the DisplayPictures form. (Ocean can be a bound object frame, command button, chart, toggle button, or unbound object frame.)

Forms!Seascape.PaintPalette = _
     Forms!DisplayPictures!Ocean.ObjectPalette

Applies to | BoundObjectFrame Object | CommandButton Object | CustomControl Object | Form Object | Image Object | ObjectFrame Object | Report Object | ToggleButton Object

See Also | PaintPalette Property | PaletteSource Property | Picture Property