Show Image. txt xlsx file in Continuous subform

ravio22

New member
Local time
Yesterday, 19:58
Joined
Jul 12, 2015
Messages
1
Hi friends,

I want to show an subform where in I would like to display images,txt,xlsx that are stored in a directory as icons which when clciked would open the respective files.
The info related to the images are stored in t_CustomerFiles.

Record ID, CustomerID, DestinationPath,EventFileName,
1, A, C:\Users\Test\Desktop\CustFiles, CustA1.jpg
2, A, C:\Users\Test\Desktop\CustFiles, CustA2.xlsx
3, B, C:\Users\Test\Desktop\CustFiles, CustB1.txt
4, C, C:\Users\Test\Desktop\CustFiles, CustC1.jpg
5, C, C:\Users\Test\Desktop\CustFiles, CustC2.jpg.

I would like to show them on a continusous sub form .. I am using image control by setting its control source property but it does not seem to work...
Do I need something else for the xlsx and txt files..
 
What you're trying won't work. There is a post that shows up in the list of "similar threads" that sounds like what you need. Re: Continuous subform - control to display image / icon based on another field (AC20007) It's marked "solved".

I would use hyperlinks. Otherwise you have to write code to open each different type of file, which can get complex quickly.
 
I've been going through some old threads so here's how you do it...

1. You will need an extra field in your table:
Code:
Record ID    ... other fields ...    FileExt
---------    ---      ---     ---    -------
1                                    jpg
2                                    xlsx
3                                    txt
4                                    jpg
5                                    jpg
2. You will also need a new table:
Code:
FileExt        ExtPath
-------        -------
jpg            C:\Users\Test\Desktop\CustFiles\jpg_ico.jpg
txt            C:\Users\Test\Desktop\CustFiles\txt_ico.jpg
xlsx           C:\Users\Test\Desktop\CustFiles\xlsx_ico.jpg
... these images will be the icon images for each file type

3. Create a query that includes both tables, join them via the FileExt field and include the ExtPath field in there plus the original fields from your main table.

4. Create a form based on the query in step (3) and drop an Image Control onto the form

5. Set the Control Source of the Image Control to the ExtPath field and set the Size Mode property to Clip.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom