Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

link picture to a specified name? 1

Status
Not open for further replies.

compaq2003

Technical User
Jan 5, 2003
7
0
0
US
hi
i have a combo box taking data from employee tables.
how i link employee's picture to thier name ?
so when i select the name from the tables his/her picture appears down?

thank u
 
put a field in your table with the directory + filename
something like c:\dir\me.jpg and name it picturename
then add all the pictures just be adding the filename and directory

on the form add an empty image and name it image1
and a textbox with the picturename field as controlsource and as name of the textbox.
on your form in the on current event set this piece of code

image1.picture = picturename

in the afterupdate event of picturename you put
call form_current



"What a wonderfull world" - Louis armstrong
 
In your Employees table create an OLE field, open the table in data sheet view, open Explorer, go to the folder where your employee images are stored. Copy each image and paste into the OLE field of the Employee record corresponding to the image.

In your Employee form, create a Bound Object Frame with its Control Source set as the OLE field name in your Employee table.

Your form will display the picture of the current Employee and update the image as you move between records.

If you want to work in various locations, at home, at work, on another pc, you won't need to remember to copy the images as they are stored in your table.
 
the only thing you have to remember is that billpowers method will make your database grow in size a lot.

but then again it is an easy method "What a wonderfull world" - Louis armstrong
 
As Chrissie Said The Database will be growing and u'll get an Error argument the best way to do is keep a huge photos in ur directory and u just need to load, lets start:

* Create field in ur table [EPics]
* Store Each Employee as it's in Ur Directory For Example "C:\MyPics\Sam.bmp,Jpg,Tif...."
* In The Form insert ActivX "Microsoft Forms 2.0" And Name it to Ctl.
* On Form Current Past This Code:
Me.ctl.Picture = LoadPicture("C:\MyPics\" & Me.EPics & ".Bmp").


Note: U Can Change The Field Name And Directory As U Wish.

Good Luck
Haitham
 
Completely agree with both of you, it was just the nature of the images, I wouldn't like my photo available to all and sundry. Should have explained better.

Chrissie1, keep up the good work, have seen quite a few good tips from you recently. Brilliant forum, isn't it, I've learned so much these past few months.

Cheers Bill
 
thanks bill,

i like the forum a lot and learn new things here nearly every day

With all these experts here it is difficult to be the first to get the answer in. but it helps being on the other side of the world.

"What a wonderfull world" - Louis armstrong
 
Hi All,

It was a good accedent that i meet this Post, good job Haitham, That was a helpfull serial.

GoodLuck All
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top