programtically change an Embedded picture of a command button

  • Thread starter Thread starter TADropik
  • Start date Start date
T

TADropik

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?
 
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
 
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
 
Back
Top