Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2006

Tip: Looking for answers? Try searching our database.

How can I Save Link/Path to Record After Browsing Folders?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kate Cz - 29 Dec 2005 16:07 GMT
Hello - can anyone help with how to save the path to a diocument into a
textbox in a record on a form?

I have successfully used the code found at
http://www.mvps.org/access/api/api0001.htm to browse the folders, but am not
able to save the document path (as a hyperlink to be accessed at any time
once saved) into the textbox i have created for the link in each record.

One recommendation in this discussion group was to use the code  Me.Text46 =
TestIt()   to link (?) the code in my module (ie the code from
http://www.mvps.org/access/api/api0001) to the text box. This places the path
found during browsing into the text box, but once I exit, the link is not
saved. The user should be able to pull up the (word) document from the record.

Thank you very much!
BruceM - 29 Dec 2005 16:25 GMT
I'm not sure just what you need to do, but if you want to insert a link into
a text box, then go to the link by clicking in the text box, one option is
to have a command button with something like the following code:

   Me.txtLink.SetFocus
   DoCmd.RunCommand acCmdInsertHyperlink

This sets the focus to txtLink, which is a text box bound to a hyperlink
field in the Record Source table (the table behind your form).  The next
line of code opens the standard Insert Hyperlink dialog box.

If the code you already have in place is generally working except for not
saving the link, the thing that occurs to me is that the text box would need
to be bound to a hyperlink field if it is not already.

> Hello - can anyone help with how to save the path to a diocument into a
> textbox in a record on a form?
[quoted text clipped - 15 lines]
>
> Thank you very much!
Kate Cz - 30 Dec 2005 17:42 GMT
Thanks Bruce and Larry. You are correct - the unbound nature of the text box
is the problem. So how about this: I have a text box that is bound to a table.
I would like the user to be able to browse for a document and insert it into
the correct field in the form (the bound text box). I see that this can be
done by right clicking in the empty field.  The menu that appears has a
Hyperlink/Hyperlink Edit option from which I can browse for the document I
want and attach it as a hyperlink into the empty field. When I exit, it is
saved.

Is there a way to do this using a command button on the form? Or should i
just create a msg. box directing the user to excute the procedure described
above?

Thank you very much.

>I'm not sure just what you need to do, but if you want to insert a link into
>a text box, then go to the link by clicking in the text box, one option is
[quoted text clipped - 16 lines]
>>
>> Thank you very much!
BruceM - 03 Jan 2006 12:23 GMT
Create a hyperlink field in the table.  I will call the field Link.  Set its
data type to Hyperlink in table design view.  Create a text box (txtLink) on
the form.  Set its record source to Link (the hyperlink field in the table).
txtLink is now bound to Link.  Create a command button on the form.  Place
the following code in its Click event:

   Me.txtLink.SetFocus
   DoCmd.RunCommand acCmdInsertHyperlink

This sets the focus to txtLink, then opens the standard Insert Hyperlink
dialog box.

Most of this is from my first posting.  If you have questions about how to
do any of this, or if the explanation is unclear, by all means ask for
clarification or further explanation, but I have to wonder why after I
explained how to use a command button you replied by asking if there was a
way to do this with a command button.

> Thanks Bruce and Larry. You are correct - the unbound nature of the text
> box
[quoted text clipped - 37 lines]
>>>
>>> Thank you very much!
Kate Cz - 03 Jan 2006 17:18 GMT
>Create a hyperlink field in the table.  I will call the field Link.  Set its
>data type to Hyperlink in table design view.  Create a text box (txtLink) on

Thanks Bruce, this worked fine and thank you for the extra explanation which
helped me figure it out.
The reason I asked about the command button again was because I was looking
to make it as easy for the user to browse folders as possible. A window comes
up allowing the users to browse folders immediately using this code:
Me.Text50 = TestIt()
but it wasn't saving the link. The code you provided does cause the link to
be saved though the user enters the folders available for browsing through a
window titled "edit hyperlink" from which they choose to browse files (unlike
the other code which took them right to the folders).  If you have any ideas
about how to go directly to the browse folders window, let me know, otherwise
the code you provided works just fine, just with an extra step. Hopefully
this makes sense. Much appreciated~
BruceM - 03 Jan 2006 17:51 GMT
I have several times wished that I could go directly to the folders window,
but have not discovered a way to do so.  That's not to say there is no way,
but only that I do not know what it is.
>>Create a hyperlink field in the table.  I will call the field Link.  Set
>>its
[quoted text clipped - 22 lines]
> the code you provided works just fine, just with an extra step. Hopefully
> this makes sense. Much appreciated~
Larry Linson - 29 Dec 2005 23:03 GMT
You can display values in Text Boxes, and those values can be saved into a
Field in a Table, but "saving in a Text Box" itself is very transitory...
only lasting while the TextBox is available. Once the Form is closed, unless
that Text Box was bound to a Field in a Table, the value is lost.

Perhaps I am misunderstanding your question.

The Imaging examples downloadable from http://accdevel.tripod.com include
samples where path and filename are saved, and where an image is saved as an
OLE Object. Neither of those is exactly what you are doing, but they may
give you a start on what you want to do. If you want to save the path and
filename as a hyperlink, you can review Help, search the Knowledge Base at
http://support.microsoft.com, and the online documentation at
http://msdn.microsoft.com.

Larry Linson
Microsoft Access MVP

> Hello - can anyone help with how to save the path to a diocument into a
> textbox in a record on a form?
[quoted text clipped - 15 lines]
>
> Thank you very much!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.