Change picture on Command button with VBA

To be honest, I've never been one to berate MS for not including things that can be achieved by other means (even if they subjectively feel convoluted). I've always wanted more things that can't be so accomplished - which, alas, have been thin on the ground in recent times.

On the topic of image support, there have actually ben advances in 2007 and 2010.
Image controls' ControlSource property was the first last such addition and given the new image gallery in Access 2010, I suppose it would count as advantageous, in that you have a repository of images stored in there - that you could refer to by name to assign to a control. So that does count as programatic support (but you do need to set up that gallery in advance naturally, and need 2010+).

Cheers.
 
Another alternative to try is to change the Picture Caption Arrangement property on your button to display both your caption and your image. Then you can change the caption to whatever you want, and just keep the same image.
 
Set MyForm.imgControl.Picture = LoadPicture(pathToFile)
MyForm.Repaint
 
Last edited by a moderator:
Create another button with desired image and set its visible property as false then at runtime set picturedata property of one to the other
 

Users who are viewing this thread

Back
Top Bottom