From: TADropik on
I'd like to prgramatically change the Embeded picture of a command button.

I don't want to use a linked picture because the application is portable and
I don't want to have to copy the image along with the .mdb

Anyone have sample code for this?
From: Jon Lewis on
Have an invisible CommandButton of the same size with the required image
embedded, then use the PictureData property.
Me.cmd1.PictureData = Me.cmd2.PictureData should do it.

-Jon

"TADropik" <tom(a)sportmutt.com> wrote in message
news:0BBECB0B-06BB-42D4-8FA4-7B0565E84E7E(a)microsoft.com...
> I'd like to prgramatically change the Embeded picture of a command button.
>
> I don't want to use a linked picture because the application is portable
> and
> I don't want to have to copy the image along with the .mdb
>
> Anyone have sample code for this?


From: fredg on
On Thu, 1 Apr 2010 08:26:07 -0700, TADropik wrote:

> I'd like to prgramatically change the Embeded picture of a command button.
>
> I don't want to use a linked picture because the application is portable and
> I don't want to have to copy the image along with the .mdb
>
> Anyone have sample code for this?

Probably quicker to simply open the form in Design View and change the
button's Picture property manually as you do need to have the picture
somewhere on the computer to set it as the button's picture, and it
will be faster than writing the below code.
However ...

Code a module

DoCmd.Echo False
DoCmd.OpenForm "FormName", acDesign, , , acFormPropertySettings,
acHidden
Forms!FormName!cmdButtonName.Picture =
"C:\PathToFolder\PictureName.ico"
DoCmd.Close acForm, "FormName", acSaveYes
DoCmd.OpenForm "FormName"
DoCmd.Echo True


--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail