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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
37,352
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
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. :)
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
37,352
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Thanks. The code is basically:

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

Phillip2

Board Regular
Joined
Aug 5, 2019
Messages
79
Office Version
  1. 365
Platform
  1. Windows
Thanks Rory that's what I needed. I really appreciate it.
 

Forum statistics

Threads
1,141,413
Messages
5,706,300
Members
421,440
Latest member
cmphares

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
Top