Hyperlinking to different documents in a form
Hyperlinking to different documents in a form
am 08.04.2008 07:47:53 von hopciti
Hi all
I'm new to the newsgroup and fairly new to Access so excuse any
naivety please.
In my database one of the tables is client info, on the form I wanted
to create a link to a word document, containing progress notes,
specific to each particular client? Is it possible? I've only been
able to link to one document for everybody, not a different document
for each client, I used a command button\hyperlinked ?
Hope I've explained it clearly enough and sorry if it's been answered
previously, I did a search but couldn't find it.
Thanks
Ian
Re: Hyperlinking to different documents in a form
am 08.04.2008 17:31:35 von Salad
hopciti wrote:
> Hi all
>
> I'm new to the newsgroup and fairly new to Access so excuse any
> naivety please.
>
> In my database one of the tables is client info, on the form I wanted
> to create a link to a word document, containing progress notes,
> specific to each particular client? Is it possible? I've only been
> able to link to one document for everybody, not a different document
> for each client, I used a command button\hyperlinked ?
>
> Hope I've explained it clearly enough and sorry if it's been answered
> previously, I did a search but couldn't find it.
>
> Thanks
>
> Ian
>
I'm not sure what your version of Access is so this link,
http://www.mvps.org/access/api/api0001.htm, is a method to call a
FileOpen dialog box. This would be the way to browse the progress document.
I suppose you could have a master progress document template. If so,
when the client record is saved, check for NewRecord then do a FileCopy.
You'd do this in the BeforeUpdate event of the form...or set a flag
there and do it in the AfterUpdate event of the form.
If Me.NewRecord then
FileCopy "C:\Templatest\Master.Doc","C:\Client\ClientNameMaster.Doc"
Endif
You can create a Hyperlink field in the table (in design mode). You can
create the display test and address for it like this
strFile = "C:\Client\ClientNameMaster.Doc"
strDisplay = "Progress Doc"
Me.DocHyper = strDisplay & "#" & strFile
In forms I preferr to separate the display text from the file name. So
I'll present to the user the display text and on dbl-click open the doc.
To present the name I use
Me.DisplayText = HyperlinkPart(Me.DocHyper,acDisplayText)
If I want to separate that out in the query builder, its
DisplayText : HyperlinkPart(Me.DocHyper,2)
as acDisplayText is equal to 1. acAddress is 2.
To open a file, I separate the address and call the routine found here.
http://www.mvps.org/access/api/api0018.htm
Dim var As Varian
strFile = Hyperlinkpart(Me.DocHyper,acaddress)
var = fHandleFile(strFile, 3) 'open it up maximized
If you have question on these functions, hightlight words like
Hyperlinkpart or Filecopy or Dir and press F1.
Otherwise
http://www.youtube.com/watch?v=xxn-fz9mjo4
Re: Hyperlinking to different documents in a form
am 09.04.2008 01:53:23 von hopciti
On Apr 9, 1:31=A0am, Salad wrote:
> hopciti wrote:
> > Hi all
>
> > I'm new to the newsgroup and fairly new to Access so excuse any
> > naivety please.
>
> > In my database one of the tables is client info, on the form I wanted
> > to create a link to a word document, containing progress notes,
> > specific to each particular client? Is it possible? I've only been
> > able to link to one document for everybody, not a different document
> > for each client, I used a command button\hyperlinked ?
>
> > Hope I've explained it clearly enough and sorry if it's been answered
> > previously, I did a search but couldn't find it.
>
> > Thanks
>
> > Ian
>
> I'm not sure what your version of Access is so this link,http://www.mvps.o=
rg/access/api/api0001.htm, is a method to call a
> FileOpen dialog box. =A0This would be the way to browse the progress docum=
ent.
>
> I suppose you could have a master progress document template. =A0If so,
> when the client record is saved, check for NewRecord then do a FileCopy.
> =A0 You'd do this in the BeforeUpdate event of the form...or set a flag
> there and do it in the AfterUpdate event of the form.
> =A0 =A0 =A0 =A0 If Me.NewRecord then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 FileCopy "C:\Templatest\Master.Doc","C:\Cl=
ient\ClientNameMaster.Doc"
> =A0 =A0 =A0 =A0 Endif
>
> You can create a Hyperlink field in the table (in design mode). =A0You can=
> create the display test and address for it like this
> =A0 =A0 =A0 =A0 strFile =3D "C:\Client\ClientNameMaster.Doc"
> =A0 =A0 =A0 =A0 strDisplay =3D "Progress Doc"
> =A0 =A0 =A0 =A0 Me.DocHyper =3D strDisplay & "#" & strFile
>
> In forms I preferr to separate the display text from the file name. =A0So
> I'll present to the user the display text and on dbl-click open the doc.
> =A0 To present the name I use
> =A0 =A0 =A0 =A0 Me.DisplayText =3D HyperlinkPart(Me.DocHyper,acDisplayText=
)
> If I want to separate that out in the query builder, its
> =A0 =A0 =A0 =A0 DisplayText : HyperlinkPart(Me.DocHyper,2)
> as acDisplayText is equal to 1. =A0acAddress is 2.
>
> To open a file, I separate the address and call the routine found here.htt=
p://www.mvps.org/access/api/api0018.htm
> =A0 =A0 =A0 =A0 Dim var As Varian
> =A0 =A0 =A0 =A0 strFile =3D Hyperlinkpart(Me.DocHyper,acaddress)
> =A0 =A0 =A0 =A0 var =3D fHandleFile(strFile, 3) =A0'open it up maximized
>
> If you have question on these functions, hightlight words like
> Hyperlinkpart or Filecopy or Dir and press F1.
>
> Otherwisehttp://www.youtube.com/watch?v=3Dxxn-fz9mjo4- Hide quoted text -
>
> - Show quoted text -
Thanks I think I've found a fairly good way to do what I want
I'm using Access 2000
In the table I've put in a Hyperlink column in this column I hyperlink
to each individual clients progress note, because the path to the
document is rather long I then right click on the link choose
Hyperlink then Display Text and change this to display 'Click Here'
On the form I put in a text box with the control source being the
hyperlink column.
This looks fairly neat, the only isuue I suppose is that it has to be
done in the table which is a bit of a no no but it's not a huge
database and will not have many new clients added to it so is
managible.
Any comments on doing it this way?
Re: Hyperlinking to different documents in a form
am 09.04.2008 06:22:00 von Salad
hopciti wrote:
> On Apr 9, 1:31 am, Salad wrote:
>
>>hopciti wrote:
>>
>>>Hi all
>>
>>>I'm new to the newsgroup and fairly new to Access so excuse any
>>>naivety please.
>>
>>>In my database one of the tables is client info, on the form I wanted
>>>to create a link to a word document, containing progress notes,
>>>specific to each particular client? Is it possible? I've only been
>>>able to link to one document for everybody, not a different document
>>>for each client, I used a command button\hyperlinked ?
>>
>>>Hope I've explained it clearly enough and sorry if it's been answered
>>>previously, I did a search but couldn't find it.
>>
>>>Thanks
>>
>>>Ian
>>
>>I'm not sure what your version of Access is so this link,http://www.mvps.org/access/api/api0001.htm, is a method to call a
>>FileOpen dialog box. This would be the way to browse the progress document.
>>
>>I suppose you could have a master progress document template. If so,
>>when the client record is saved, check for NewRecord then do a FileCopy.
>> You'd do this in the BeforeUpdate event of the form...or set a flag
>>there and do it in the AfterUpdate event of the form.
>> If Me.NewRecord then
>> FileCopy "C:\Templatest\Master.Doc","C:\Client\ClientNameMaster.Doc"
>> Endif
>>
>>You can create a Hyperlink field in the table (in design mode). You can
>>create the display test and address for it like this
>> strFile = "C:\Client\ClientNameMaster.Doc"
>> strDisplay = "Progress Doc"
>> Me.DocHyper = strDisplay & "#" & strFile
>>
>>In forms I preferr to separate the display text from the file name. So
>>I'll present to the user the display text and on dbl-click open the doc.
>> To present the name I use
>> Me.DisplayText = HyperlinkPart(Me.DocHyper,acDisplayText)
>>If I want to separate that out in the query builder, its
>> DisplayText : HyperlinkPart(Me.DocHyper,2)
>>as acDisplayText is equal to 1. acAddress is 2.
>>
>>To open a file, I separate the address and call the routine found here.http://www.mvps.org/access/api/api0018.htm
>> Dim var As Varian
>> strFile = Hyperlinkpart(Me.DocHyper,acaddress)
>> var = fHandleFile(strFile, 3) 'open it up maximized
>>
>>If you have question on these functions, hightlight words like
>>Hyperlinkpart or Filecopy or Dir and press F1.
>>
>>Otherwisehttp://www.youtube.com/watch?v=xxn-fz9mjo4- Hide quoted text -
>>
>>- Show quoted text -
>
>
> Thanks I think I've found a fairly good way to do what I want
>
> I'm using Access 2000
>
> In the table I've put in a Hyperlink column in this column I hyperlink
> to each individual clients progress note, because the path to the
> document is rather long I then right click on the link choose
> Hyperlink then Display Text and change this to display 'Click Here'
>
> On the form I put in a text box with the control source being the
> hyperlink column.
> This looks fairly neat, the only isuue I suppose is that it has to be
> done in the table which is a bit of a no no but it's not a huge
> database and will not have many new clients added to it so is
> managible.
>
> Any comments on doing it this way?
Yes. Do whatever you do that works.
I would create the document and store the path to a string or part of
the hyperlink.