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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image on forms

Status
Not open for further replies.

Cristyen

Technical User
May 29, 2001
1
CH
Hi
I'm doing an Inventory DB (Access2K) for my chemistry laboratory product.
We have 5 images concerning the toxicity of products : corrosiv, toxic, flammable, neutral, explosiv. I have one form (FrmEnterProduct) (students cannot see that form) where i enter new product and on this form i would like to place these 5 images with 5 check boxes. One product can be flammable, corrosiv and explosiv, so i have to have multiple choice. And on the other form (FrmProductList), where students can see the list of the products, i would like to have these images appeared near the name of the product according to the entry on FrmEnterProduct. Can someone explain me how to do that with a piece of code.
Thanks a lot.
Cristyen
 
Hi Cristyen!

Create table for images what is related to table for Products.

(bold ->> Fields with Primary keys
blue ->> Table names
green -> Field type)
Products
ProductID

ProductName
ProdImage1 same ImageID of table Images
ProdImage2 same ImageID of table Images
ProdImage3 same ImageID of table Images
ProdImage4 same ImageID of table Images
ProdImage5 same ImageID of table Images

Images
ImageID

ImageName
ProductImage OLE

Save all your images in the table Images with different ImageID

Put in the ProdImage1,2,3,4,5 needed ImageID from table Images. Keep empty non-needed ProdImageX fields.

Now you can create form what will show all necessary images of each product after each choosing of products list.

SQL example:
SELECT [Products].[ProductID], [Products].[ProductName], [Images].[ProductImage] AS Img1, Images_1.ProductImage AS Img2, Images_2.ProductImage AS Img3, Images_3.ProductImage AS Img4, Images_4.ProductImage AS Img5
FROM ((((Products LEFT JOIN Images ON [Products].[ProdImage1]=[Images].[ImageID]) LEFT JOIN Images AS Images_1 ON [Products].[ProdImage2]=Images_1.ImageID) LEFT JOIN Images AS Images_2 ON [Products].[ProdImage3]=Images_2.ImageID) LEFT JOIN Images AS Images_3 ON [Products].[ProdImage4]=Images_3.ImageID) LEFT JOIN Images AS Images_4 ON [Products].[ProdImage5]=Images_4.ImageID;

This only is idea how to solve your problem. It are lot of other ways how to do it.

Good luck!
Aivars
alaganovskis@hotmail.com


 
Hi Cristyen!

Create table for images what is related to table for Products.

(bold - Fields with Primary keys
blue - Table names
green - Field type)
Products
ProductID

ProductName
ProdImage1 same ImageID of table Images
ProdImage2 same ImageID of table Images
ProdImage3 same ImageID of table Images
ProdImage4 same ImageID of table Images
ProdImage5 same ImageID of table Images

Images
ImageID

ImageName
ProductImage OLE

Save all your images in the table Images with different ImageID

Put in the ProdImage1,2,3,4,5 needed ImageID from table Images. Keep empty non-needed ProdImageX fields.

Now you can create form what will show all necessary images of each product after each choosing of products list.

SQL example:
SELECT [Products].[ProductID], [Products].[ProductName], [Images].[ProductImage] AS Img1, Images_1.ProductImage AS Img2, Images_2.ProductImage AS Img3, Images_3.ProductImage AS Img4, Images_4.ProductImage AS Img5
FROM ((((Products LEFT JOIN Images ON [Products].[ProdImage1]=[Images].[ImageID]) LEFT JOIN Images AS Images_1 ON [Products].[ProdImage2]=Images_1.ImageID) LEFT JOIN Images AS Images_2 ON [Products].[ProdImage3]=Images_2.ImageID) LEFT JOIN Images AS Images_3 ON [Products].[ProdImage4]=Images_3.ImageID) LEFT JOIN Images AS Images_4 ON [Products].[ProdImage5]=Images_4.ImageID;

This only is idea how to solve your problem. It are lot of other ways how to do it.

Good luck!
Aivars
alaganovskis@hotmail.com


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top