Alternate Pictures Depending on ID

louisa

Registered User.
Local time
Today, 06:14
Joined
Jan 27, 2010
Messages
262
I use my access db for work purposes and we have two companies that operate the same type of business so we only require the one db. We also use screen popping so the customers telephone number is recognised when dialling in and the database will open of that particular customer, in order to answer in the correct company name i would like it so that when you select the customer the company they are with logo is in the corner to determine the company or something like that does anyone have any ideas?
 
it's all depand how you store the pictures

if you store them inside the db you can put it as any other object on the form - a picture opbject bound to the picture field.
This might bloat your db size. Look for blob how to store pictures without bloating db size.

you can also save only a pointer to the full name of the picture (picture full dir structure + name) and use a bit of code to replace the picture you see in the picture object

Me.PictureObject.Picture = FullPictureName

put this code in the Form open or the OnCurrent events of the form
 
I have an example on parodux.com in the section 'gratis' it's called 'Vis billeder i din database' and you are welcome to download and use the code!~)
 
I did this with a Lock, Unlock picture. All I did was put the pictures directly ontop of one another and hid/unhid them as needed, depending on certain events happening.
 
Firstly, you store the image and use name that relates to the ID.

ID1 image file is 1.jpg

Secondly, a query needs to be used to asemble the full file name, lets assume that the images are held:

C:\Databases\Images\

Therefore the full file name would be:

C:\Databases\Images\1jpg

In your query you should an Expression:

ImageFile = "C:\Databases\Images\" & ID & ".jpg

Thirdly, if you are using Access 2007 and above use the Image Control and its Control source should be: =[ImageFile]

I first developed Images in Access 1997 and use a more complicated method. The above method works for continuous forms but should work for a normal form.

There is no need to store images within a database unless you want total portability.

Simon
 

Users who are viewing this thread

Back
Top Bottom