From: Williams on 4 May 2010 12:42 I have a field that is a Hyperlink data type. The field contains the path to a PDF files. When I click the hyperlink in the table or form view a new window starts to appear then disappears immediately. Why can't I just click the window and have the hyperlink automatically appear on my screen? If I manually go to the directory that stores the PDF I can open the file. Any suggestions?
From: Mark Andrews on 4 May 2010 17:43 I would use the shell function: Option Compare Database Option Explicit Private 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 Public Function OpenDoc(ByVal DocFile As String) As Long OpenDoc = ShellExecute(0&, vbNullString, DocFile, vbNullString, vbNullString, vbNormalFocus) End Function With some kind of click event to call the code: Private Sub cmdOpenDirectory_Click() If (Nz(Me.DocumentDirectory, "") <> "") Then Call OpenDoc(Me.DocumentDirectory) Else MsgBox "You must assign a document directory.", vbOKOnly, "Error" End If End Sub HTH, -- Mark Andrews RPT Software http://www.rptsoftware.com http://www.donationmanagementsoftware.com "Williams" <Williams(a)discussions.microsoft.com> wrote in message news:A75F62DE-DA25-478B-9C4A-013A0D672632(a)microsoft.com... > I have a field that is a Hyperlink data type. The field contains the path > to > a PDF files. When I click the hyperlink in the table or form view a new > window starts to appear then disappears immediately. Why can't I just > click > the window and have the hyperlink automatically appear on my screen? If I > manually go to the directory that stores the PDF I can open the file. Any > suggestions?
From: Williams on 6 May 2010 15:29 I am beginning to think that perhaps my problem is related to Adobe. After I read your post, I thought to myself "why all the code for a hyperlink field". I thought the purpose of the hyperlink data type was so you could just click the path and open the file. All of my hyperlinks are to PDF files, so as a test I did a hyperlink to an different file format & it worked fine. Any ideas on why other file formats would open in a hyperlink field, but not an adobe file? As I mentioned previously, I can open the adobe file without a problem outside of access. But when I click the hyperlink to the adobe file the window partially appears then disappears. "Mark Andrews" wrote: > I would use the shell function: > Option Compare Database > Option Explicit > > Private 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 > Public Function OpenDoc(ByVal DocFile As String) As Long > OpenDoc = ShellExecute(0&, vbNullString, DocFile, vbNullString, > vbNullString, vbNormalFocus) > End Function > > > > With some kind of click event to call the code: > Private Sub cmdOpenDirectory_Click() > If (Nz(Me.DocumentDirectory, "") <> "") Then > Call OpenDoc(Me.DocumentDirectory) > Else > MsgBox "You must assign a document directory.", vbOKOnly, "Error" > End If > End Sub > > > HTH, > > -- > Mark Andrews > RPT Software > http://www.rptsoftware.com > http://www.donationmanagementsoftware.com > > "Williams" <Williams(a)discussions.microsoft.com> wrote in message > news:A75F62DE-DA25-478B-9C4A-013A0D672632(a)microsoft.com... > > I have a field that is a Hyperlink data type. The field contains the path > > to > > a PDF files. When I click the hyperlink in the table or form view a new > > window starts to appear then disappears immediately. Why can't I just > > click > > the window and have the hyperlink automatically appear on my screen? If I > > manually go to the directory that stores the PDF I can open the file. Any > > suggestions? > > . >
From: Mark Andrews on 6 May 2010 17:35 Here's a guess: http://support.microsoft.com/kb/897755 "Williams" <Williams(a)discussions.microsoft.com> wrote in message news:E904D23D-E895-4306-A30A-0C4A47632DB7(a)microsoft.com... > I am beginning to think that perhaps my problem is related to Adobe. > After I > read your post, I thought to myself "why all the code for a hyperlink > field". > I thought the purpose of the hyperlink data type was so you could just > click > the path and open the file. All of my hyperlinks are to PDF files, so as > a > test I did a hyperlink to an different file format & it worked fine. Any > ideas on why other file formats would open in a hyperlink field, but not > an > adobe file? As I mentioned previously, I can open the adobe file without > a > problem outside of access. But when I click the hyperlink to the adobe > file > the window partially appears then disappears. > > "Mark Andrews" wrote: > >> I would use the shell function: >> Option Compare Database >> Option Explicit >> >> Private 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 >> Public Function OpenDoc(ByVal DocFile As String) As Long >> OpenDoc = ShellExecute(0&, vbNullString, DocFile, vbNullString, >> vbNullString, vbNormalFocus) >> End Function >> >> >> >> With some kind of click event to call the code: >> Private Sub cmdOpenDirectory_Click() >> If (Nz(Me.DocumentDirectory, "") <> "") Then >> Call OpenDoc(Me.DocumentDirectory) >> Else >> MsgBox "You must assign a document directory.", vbOKOnly, "Error" >> End If >> End Sub >> >> >> HTH, >> >> -- >> Mark Andrews >> RPT Software >> http://www.rptsoftware.com >> http://www.donationmanagementsoftware.com >> >> "Williams" <Williams(a)discussions.microsoft.com> wrote in message >> news:A75F62DE-DA25-478B-9C4A-013A0D672632(a)microsoft.com... >> > I have a field that is a Hyperlink data type. The field contains the >> > path >> > to >> > a PDF files. When I click the hyperlink in the table or form view a >> > new >> > window starts to appear then disappears immediately. Why can't I just >> > click >> > the window and have the hyperlink automatically appear on my screen? >> > If I >> > manually go to the directory that stores the PDF I can open the file. >> > Any >> > suggestions? >> >> . >>
|
Pages: 1 Prev: DatePart in Filter By Form field Next: Details of how Filter By Form works |