Inserting an dynamic image into a form

Phillip2

Board Regular
Joined
Aug 5, 2019
Messages
79
Office Version
  1. 365
Platform
  1. Windows
I have a command button (ADD / EDIT) that looks at my customer's record number (TBrecord.value). If there isn't a number it assigns one, otherwise it edits the existing record.
The second page of my userform contains a picture insert. I'm wanting to change this picture to a jpg image of a call tree diagram. These images are stored in a folder titled Images and are named with the customer's record number 001, 002, 003 etc. (TBrecord.value).

I am trying to come up with a macro that I can add inside of my sub that will use the customer's record number (TBrecord.value) and insert it inside of the image's address when this sub is used.

CallTree.Picture = Load Picture ("Y:\CCX Applications\") & ("TBrecord.jpg")

Thanks in advance. I appreciate any help.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Please take a moment to re-read the forum rules on cross-posting and then follow them. (they are the same as at the other forum where you have posted this, also without links). Thanks. :)
 
Upvote 0
Thanks. The code is basically:

Code:
CallTree.Picture = LoadPicture("Y:\CCX Applications\" & TBrecord.Text & ".jpg")
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,669
Members
448,977
Latest member
moonlight6

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top