Jumat, 10 Mei 2013

Re: [MS_AccessPros] Allowing a user to select a file and insert a hyperlink to the file

 

John V.,
I changed the code adding what you sent. It works with a .doc or .pdf, I can click on the new link and the file opens. However, if I have a spreadsheet (.xls or .xlsx) when I try to open the spreadsheet, when I click on the link to open it, Excel opens and I can see that the selected spreadsheet says it is open, however, I can't see the spreadsheet it displays like a screenshot of the database screen.

Any suggestions?

Also, once I capture the link, I would like to strip off everything but the file name and store that in txtDocumentName. For example: the link is: \\server\directory\MyDoc.doc. I want to store MyDoc in txtDocumentName.

John

--- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@...> wrote:
>
> Do this:
>
> Me.txtFlaggedDocumentLink = "#" & fileName
>
>
> John Viescas, Author
> Microsoft Access 2010 Inside Out
> Microsoft Access 2007 Inside Out
> Microsoft Access 2003 Inside Out
> Building Microsoft Access Applications
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of jfakes.rm
> Sent: Thursday, May 09, 2013 10:43 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Allowing a user to select a file and insert a
> hyperlink to the file
>
> I'm trying to create a command button on a form that allows a user to browse
> to a file and once selected, insert the hyperlink to the file.
>
> The hyperlink address needs to be saved in a field called:
> txtFlaggedDocumentLink (which is a hyperlink field).
>
> I've pieced together the following after searching the web, however, while
> the path to the filename is saved correctly, when I click on the link, it
> doesn't work. It appears to be a hyperlink, but it won't work.
>
> Private Sub cmdFindFile_Click()
> 'Sub getFileName()
> ' Displays the Office File Open dialog to choose a file.
> Dim fileName As String
> Dim result As Integer
> With Application.FileDialog(1) ' 3 is a constant: msoFileDialogFilePicker
> .Title = "Select File"
> .Filters.Add "All Files", "*.*"
> .FilterIndex = 1
> .AllowMultiSelect = False
> '.InitialFileName = CurrentProject.Path
> ' This opens the NCQA library folder to start the search.
> .InitialFileName = "\\Rmregfile017\ncqalibrary"
> result = .Show
> If (result <> 0) Then 'result = 0 if nothing was selected fileName =
> Trim(.SelectedItems.Item(1)) 'filename contains the path you want.
> Me.txtFlaggedDocumentLink = fileName
>
> End If
> End With
>
> End Sub
>
> Any suggestions?
>
> I also tried,
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar