How can I open a JPG in a path ?

Skerdi

Registered User.
Local time
Today, 09:06
Joined
Jun 27, 2007
Messages
47
Hello all.
I've created a simple database in access. I have a filed there called PATH and there is the path of e file there :
Eg. C:\folder\1.jpg
This Field for the second record is : c:\folder\2.jpg and so on.
Now in a form I'd like to navigate in these records and if I stop somewhere I'd like to open the current JPG file. So the path is in a field. I found that the Microsoft Picture and Fax Viewer (as an application) is : rundll32.exe C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen.

If I put a space after this and type c:\folder\3.jpg then the buton will open the file 3.jpg.
Can someone tell me how to open the current file if I'm browsing the records?

Thankyou in advance
 
Hi, Skerdi!

If I understood correctly your problem, I would do following (as I have done before in many different kinds of docs):
1) I would create CommandButton1 (you can name it different name).
2) On Current event of the Form I would Me.CommandButton1.HyperlingAddress="Path to the physical file" (The content of the field that stores the PATH)

Well, the button itself should be placed into Body of the form so if it is continuous form that this button is at every row.

It Should work then.

Krava
 
Thanks Krava, but what do you mean with "Path to the physical file"? Do you mean : Forms!Form1!PATH?
So if I go to another record ... the buton will open the current Picture ?
 
Hi, Skerdi!

Sorry for my poor explanation.

Basically, you are right. Yes, teh HyperlingAddress property will be change every time the CurrentRecord will be changed, means during event OnCurrent. You have to read the stored path from your current record's field (Named PATH) and to make Me.CommandButton1.HyperlingAddress=me![PATH], so place this code in OnCurrent Event procedure.
And, if zou want, zou can also check if the content of PATH field is not emptz. If so you have to set the link back to empty (means ""): Me.CommandButton1.HyperlingAddress="".

Krava
 
Krava,
You are GREAT !!
Thankyou Thankyou Thankyou :)
 

Users who are viewing this thread

Back
Top Bottom