Picture File (1 Viewer)

aziz rasul

Active member
Local time
Today, 20:46
Joined
Jun 26, 2000
Messages
1,935
Using VBA, how do I dynamically find the filepath and filename of a picture on a command button. I want to change the picture when cmdGo is pressed. The pictures are the ones that appear on the list when you create the button and can be accessed by the Picture property.

Note each user may have a different path to the file, hence the reason why I want to do this on the fly.
 

Minty

AWF VIP
Local time
Today, 20:46
Joined
Jul 26, 2013
Messages
10,371
I think the pictures you can get to via the drop down picker are embedded in a DLL with the Access install, so I'm not sure you can do much with them?

Happy to be proved wrong as always :)
 

Grumm

Registered User.
Local time
Today, 21:46
Joined
Oct 9, 2015
Messages
395
The pictures are indeed the same for all users that use Access. So you shouldn't need to find the path to that file. It is loaded when you launch the program.
Why not just change the picture of the control and that is it ?
 

aziz rasul

Active member
Local time
Today, 20:46
Joined
Jun 26, 2000
Messages
1,935
Why not just change the picture of the control and that is it ?

I don't want the user to go into design view and do this.

Is the filepath the same in each computer when it's installed? How do I obtain this filepath?
 

Minty

AWF VIP
Local time
Today, 20:46
Joined
Jul 26, 2013
Messages
10,371
Is the filepath the same in each computer when it's installed? How do I obtain this filepath?

I think you're not understanding - there is no file in a file path to get to. So there's no point in getting the path.

And a user should never get to design view - save your DB as as ACCDE, and or install the runtime.
 

aziz rasul

Active member
Local time
Today, 20:46
Joined
Jun 26, 2000
Messages
1,935
Hmm a bit confused. On some websites they show a file path, e.g.

Code:
Me.cmdGo.Picture = "C:\some_filepath\somefilename.png"

as if the files are stored in a specific location? Apologies if I seem a bit dumb on this.
 

Minty

AWF VIP
Local time
Today, 20:46
Joined
Jul 26, 2013
Messages
10,371
No apology required, it is a bit confusing - There is a path if you specify an external picture to use.
However the "in-built" button images are not listed like that, as they are stored differently.
 

Users who are viewing this thread

Top Bottom