Unanswered: Opening a picture using the path from an edit box
I got a problem. My table has a column called Picture where u can put the name of a picture with full path something like c:\newfolder\picture.jpg. What I want to do is to build an event for a button that once clicked opens that picture in Irfan View.
the followin works for any file type with the right associations set up.
just call the run_Doc function with your txtFilename field...
Const SW_SHOWNORMAL = 1
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Function run_Doc(p_DocName As String)
On Error GoTo run_Doc_Error
run_Doc = ShellExecute(Application.hWndAccessApp, "Open", p_DocName, "", "c:\", SW_SHOWNORMAL)
MsgBox "Error: " & Err & ", " & Error
run_Doc = False
Call run_Doc("c:\my pictures\my.jpg")
Re: Opening a picture using the path from an edit box
I have a table called "TableName" with two columns: one called "id" that is auto number and is primary key and one called "file" that is text type.
I also have a form called "FormName" with a listbox that is asociatted to the field "file" and a button that it doesn't do nothing. What should I do so the button once clicked opens a picture in Irfan View? The name and path of the picture should be read from the field "file".
The listbox has the name "lstImage" and the button "cmdButton".