Getting pictures/images into a access database

Deitrus

New Member
Joined
Jan 31, 2004
Messages
22
I am creating a progam that will be keeping stats for all sorts of football players (it's project that I am working on). I am able to get all of the players information such as stats, birth, yrs pro, ect. however, I am unable to figure out how to get their picture next to their name .Nn the image below is an example on how I want it to look. The image of the player you see below is a "cut & paste" image and not what I put there in access. However, this is how I want it to look. How do I get pics like this to show up for each player on their own "player card"? Thanks for any help and always it is appreciated.

8725774.jpg
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Easy enough,

Add a field to your players table that will store the name of the picture for each player (text). Now make an empty file folder, and put it next to wherever this db resides on your hard drive (or network).

Name this new folder "Pics", and copy into all the pictures you need for your players.

Add a picture to your form in the db, and have it look up anything, it doesn't matter. Change the size mode to zoom. Add a textbox to this form that is bound to the new field you just made. Name the picture img1, and the textbox txtPicPath.

Finally, in this new field, type in the name of the pictures you pasted into your new folder. Don't type in anything but the name of the file itself, so for c:\files\dbs\PlayersDB\Pics\Player1.jpg, yu would just record "Player1.jpg".

Finally, use code like the following to refresh the images source with the approriate file acquired from the new field:
Code:
Private Sub Form_Current()

    On Error Resume Next

    myPath = Application.CurrentProject.Path & "\pics\"

    img1.Picture = myPath & txtPicPath

End Sub

This method will figure out the location of your db, so as long as you keep your pics in a folder called "pics" right next to the db, they will always be found. If you were to record the full pathname of the pictures, and then move the db, they wouldn't be found.
 
Upvote 0
I have a small question to ask about this. I thinik I almost got this.

OK, where you said, "Finally, in this new field, type in the name of the pictures you pasted into your new folder".


Whcih field are you speaking of here. Sorry for the dumb question and thanks again for the help. :)
 
Upvote 0
Add a field to your players table that will store the name of the picture for each player (text). Now make an empty file folder, and put it next to wherever this db resides on your hard drive (or network).
 
Upvote 0
Yeah, I figured it out right after I posted the question and everything is working great. :) Thank you once again.

I tried to post a reply about me figuring it out but my ISP was down.
 
Upvote 0
Hi,

Ive inserted a picture with zoom

Also a seperate bound txt box and named it so

A folder is also available next to the db. with all pictures

Still no joy though!
 
Upvote 0

Forum statistics

Threads
1,221,622
Messages
6,160,887
Members
451,676
Latest member
Assy Bissy

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