Linked pictures

Sorry for the delay.

Whether the Image control is on a Form or Report, the variability in my case is the Stock Reference which so happens to be a work of Art.

So on the Form or Report I have the ImageFile Control which is declared in the underlying RecordSource Query - Stock Record 10000
ImageFile: [Orig Old Stock] & ".jpg"
GetImageDir represents "C:\inetpub\wwwroot\Demo\Originals\"

FullPath = "C:\inetpub\wwwroot\Demo\Originals\10000.jpg

Setting the ImageControl to Invisible is necessary for Reports so that the previous image is not repeated if no image is avialable.

Simon
 
Last edited:
Peter,

Give me what you are trying to achieve:

Image Directory
Identifier for the Image
Type of Image

Simon
 
Peter Bellamy, the component we have developed can do this without any coding.
Beside that, it can make adding new images to database easy for users as 1-2-3.

You can download it here - http://access.bukrek.net/download
 
Hmmm that doesn't sound like spam in any way whatsoever
 
Thanks again for your help with this.

The form is a subform and the image control and this code is on it.
In the On Current event

Code:
With CodeContextObject
FullPath = "Z:\Database\2000\Returns\images\" & Trim(Str(return_no)) & ".jpg"
Debug.Print FullPath
If Dir([FullPath]) <> Empty Then
.[PartImage].Visible = True
.[PartImage].Picture = LoadPicture(FullPath)
Else
.[PartImage].Visible = False
End If
End With

It is finding the jpg file when there or not so Fullpath is correct.
It errors on the .Visible lines. Type mismatch #13

Image control details are:
Name PartImage
Picture (none)
Picture Type Embedded
Size Mode Zoom
Pic' Alignment Center
Visible Yes

As the form this is working with is already fairly full and seeing the picture is not needed every time it is opened, my intention was to detect existence of the associated picture. Make a button visible that opens a new form that contains the picture.

peter
 
This is a demo of file I did in VB but translated into Access you will need two images to make it work. Follow the instructions on screen and dialog message boxes.

The basic concept of this demo was to allow the user to edit the image via paint. And save the changes.
 

Attachments

It errors on the .Visible lines. Type mismatch #13

Visible Yes

It seems that Visual Basic expects not True/False here. Maybe its Yes/No?

Make visual basic to prompt you the choice. Usually "WITH" construction prevents VB from helping you. Write the line:

CodeContextObject.[PartImage].Visible =

and VB will prompt you the accepted syntax. If not, press Ctrl+Space while staying after "=" sign.
 
I have attached a sample of what you need. It works like a charm. Unfortunately I can't remember from where on the net I got it from. If you do, say a BIG thank you to him.
 

Attachments

I have now got the original code working, embarrissingly it was errorring because of a typo !

Thanks mtn, that is really neat!
David C: Thanks for your input as well but having sorted my spelling the code is working.
MaxD: True/False is the correct syntax

Thanks to all responders.

peter
 

Users who are viewing this thread

Back
Top Bottom