Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: Hyperlinks

Geek News

Hyperlinks
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> 12/22/2008 6:56:01 PM
I'm not sure if I've understood this right or if I'm just doing something
wrong - maybe someone can help me?

I think it should be possible to have a field of the data type hyperlink and
to link to a document (PDF for example) on my hard drive and by clicking
that hyperlink to have the document open?

Well if that is the case it's not working for me and yet it seems like it
should be straightforward. I have a field of the correct data type in my
table. I have a data entry form and have clicked in the relevant filed and
have selected Insert>Hyperlink and have navigated to the file in question.
The file has an application associated with it - but it doesn't open.

Can anyone suggest what the problem might be? I'd be grateful for any help.



RE: Hyperlinks
Wayne-I-M 12/22/2008 7:28:04 PM
try this

http://www.mvps.org/access/api/api0018.htm


--
Wayne
Trentino, Italia.



"gavin" wrote:

[Quoted Text]
> I'm not sure if I've understood this right or if I'm just doing something
> wrong - maybe someone can help me?
>
> I think it should be possible to have a field of the data type hyperlink and
> to link to a document (PDF for example) on my hard drive and by clicking
> that hyperlink to have the document open?
>
> Well if that is the case it's not working for me and yet it seems like it
> should be straightforward. I have a field of the correct data type in my
> table. I have a data entry form and have clicked in the relevant filed and
> have selected Insert>Hyperlink and have navigated to the file in question.
> The file has an application associated with it - but it doesn't open.
>
> Can anyone suggest what the problem might be? I'd be grateful for any help.
>
>
>
>
Re: Hyperlinks
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> 12/22/2008 7:36:37 PM

"Wayne-I-M" <WayneIM[ at ]discussions.microsoft.com> wrote in message
news:F6F1C848-B83B-495B-AEE1-125D328CD52A[ at ]microsoft.com...
[Quoted Text]
> try this
>
> http://www.mvps.org/access/api/api0018.htm
>
>
> --
> Wayne
> Trentino, Italia.

Yikes! What do I do with that????


RE: Hyperlinks
Dale Fye 12/22/2008 7:53:02 PM
If you have a text field in a form, you should be able to copy the URL (or
path\file name) from your web browser or windows explorer, and paste that
value into the text field on your form. Then, when you click on that
textbox, it should navigate you to the URL or file.

Personally, I dislike the hyperlink datatype, and prefer to use text or memo
fields (for really long URLs). Then, I put a command button next to the
textbox on my forms and use the application.followhyperlink method in the
Click event of that button to follow the hyperlink to the URL or file.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.



"gavin" wrote:

[Quoted Text]
> I'm not sure if I've understood this right or if I'm just doing something
> wrong - maybe someone can help me?
>
> I think it should be possible to have a field of the data type hyperlink and
> to link to a document (PDF for example) on my hard drive and by clicking
> that hyperlink to have the document open?
>
> Well if that is the case it's not working for me and yet it seems like it
> should be straightforward. I have a field of the correct data type in my
> table. I have a data entry form and have clicked in the relevant filed and
> have selected Insert>Hyperlink and have navigated to the file in question.
> The file has an application associated with it - but it doesn't open.
>
> Can anyone suggest what the problem might be? I'd be grateful for any help.
>
>
>
>
Re: Hyperlinks
Ron2006 <ronnemec[ at ]hotmail.com> 12/22/2008 7:58:59 PM
1) you have NOT told us what is happening, if anything.

2) Another way is to have the field be simply a txt field and as long
as you can establish the entire path for the document name that you
place there you can have the <dbl-click> event issue the following

application.followhyperlink entirepathnameforfile


This usually makes it easier to input data since the user can simply
enter the actual file name AS LONG AS the rest of the path information
can be optained.

If this is a split split application or multi user application, having
something on YOUR hard drive will not work since the other users will
most like NOT be able to get to the file since C:\ will be
considered to be on THEIR hard drive.

Ron
Re: Hyperlinks
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> 12/22/2008 8:07:53 PM

"Ron2006" <ronnemec[ at ]hotmail.com> wrote in message
news:778de06d-bcf8-4e86-a9c8-908a54eed650[ at ]i20g2000prf.googlegroups.com...
[Quoted Text]
> 1) you have NOT told us what is happening, if anything.
>
> 2) Another way is to have the field be simply a txt field and as long
> as you can establish the entire path for the document name that you
> place there you can have the <dbl-click> event issue the following
>
> application.followhyperlink entirepathnameforfile
>
>
> This usually makes it easier to input data since the user can simply
> enter the actual file name AS LONG AS the rest of the path information
> can be optained.
>
> If this is a split split application or multi user application, having
> something on YOUR hard drive will not work since the other users will
> most like NOT be able to get to the file since C:\ will be
> considered to be on THEIR hard drive.
>
> Ron

Many thanks for that, Ron. Actually nothing was happening!

I shall try your work round tomorrow.

Your help is appreciated.


Re: Hyperlinks
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> 12/22/2008 9:08:43 PM

"Dale Fye" <dale.fye[ at ]nospam.com> wrote in message
news:80D55755-17FF-4F3F-82D6-CC8108A6ACEB[ at ]microsoft.com...
[Quoted Text]
> If you have a text field in a form, you should be able to copy the URL (or
> path\file name) from your web browser or windows explorer, and paste that
> value into the text field on your form. Then, when you click on that
> textbox, it should navigate you to the URL or file.
>
> Personally, I dislike the hyperlink datatype, and prefer to use text or
> memo
> fields (for really long URLs). Then, I put a command button next to the
> textbox on my forms and use the application.followhyperlink method in the
> Click event of that button to follow the hyperlink to the URL or file.
>
> --
> HTH
> Dale
>

Many thanks also to you, Dale. Hopefully I should be sorted now.


Re: Hyperlinks
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> 12/23/2008 7:19:36 PM

"Dale Fye" <dale.fye[ at ]nospam.com> wrote in message
news:80D55755-17FF-4F3F-82D6-CC8108A6ACEB[ at ]microsoft.com...
[Quoted Text]
> If you have a text field in a form, you should be able to copy the URL (or
> path\file name) from your web browser or windows explorer, and paste that
> value into the text field on your form. Then, when you click on that
> textbox, it should navigate you to the URL or file.
>
> Personally, I dislike the hyperlink datatype, and prefer to use text or
> memo
> fields (for really long URLs). Then, I put a command button next to the
> textbox on my forms and use the application.followhyperlink method in the
> Click event of that button to follow the hyperlink to the URL or file.
>
> --
> HTH
> Dale

I had a go at this today, Dale, but I have to admit that I'm pretty clueless
with VBA - and it didn't work! Either because my code was wrong - or for
another reason entirely.

My code is:

Private Sub Command52_Click()

Application.FollowHyperlink ("R:\..............\Thank you letter.pdf")

End Sub

The PDF is on a network (R:\) drive.

When I click the command button to fire this code it looks like something is
trying to happen because the screen kind of flickers - that's not describing
it too well - but I don't get an error message.

Is the code OK? What else could it be?


Re: Hyperlinks
"Dale Fye" <dale.fye[ at ]nospam.com> 12/24/2008 3:42:26 AM
gavin

Have you checked to see whether it opened in the background (behind Access)?
I just ran that code in the immediate window of A2007, and it flashed, then
showed me the access window again. When I did Alt-Tab, it showed me the
Word document I had opened, with it visible.

I'm not sure why it did not make word the active application. This is the
first time I've used that code in 2007, but it has worked great for me in
2003, in the past.

Dale

"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> wrote in message
news:bRa4l.140141$hm4.132353[ at ]fe05.news.easynews.com...
[Quoted Text]
>
> "Dale Fye" <dale.fye[ at ]nospam.com> wrote in message
> news:80D55755-17FF-4F3F-82D6-CC8108A6ACEB[ at ]microsoft.com...
>> If you have a text field in a form, you should be able to copy the URL
>> (or
>> path\file name) from your web browser or windows explorer, and paste that
>> value into the text field on your form. Then, when you click on that
>> textbox, it should navigate you to the URL or file.
>>
>> Personally, I dislike the hyperlink datatype, and prefer to use text or
>> memo
>> fields (for really long URLs). Then, I put a command button next to the
>> textbox on my forms and use the application.followhyperlink method in the
>> Click event of that button to follow the hyperlink to the URL or file.
>>
>> --
>> HTH
>> Dale
>
> I had a go at this today, Dale, but I have to admit that I'm pretty
> clueless with VBA - and it didn't work! Either because my code was wrong -
> or for another reason entirely.
>
> My code is:
>
> Private Sub Command52_Click()
>
> Application.FollowHyperlink ("R:\..............\Thank you letter.pdf")
>
> End Sub
>
> The PDF is on a network (R:\) drive.
>
> When I click the command button to fire this code it looks like something
> is trying to happen because the screen kind of flickers - that's not
> describing it too well - but I don't get an error message.
>
> Is the code OK? What else could it be?
>


Re: Hyperlinks
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> 12/24/2008 5:42:53 PM

"Dale Fye" <dale.fye[ at ]nospam.com> wrote in message
news:esCmqmXZJHA.5272[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text]
> gavin
>
> Have you checked to see whether it opened in the background (behind
> Access)? I just ran that code in the immediate window of A2007, and it
> flashed, then showed me the access window again. When I did Alt-Tab, it
> showed me the Word document I had opened, with it visible.
>
> I'm not sure why it did not make word the active application. This is the
> first time I've used that code in 2007, but it has worked great for me in
> 2003, in the past.
>
> Dale
>

Hi Dale,
That was exactly what was happening for me - the screen just flashed but
Access was still the active Window - and the target document did not appear
on the task bar. However, having tried this again and doing what you
suggest, i.e. Alt-Tab, I find that the application is indeed open! Slightly
odd behaviour - a minor bug? - but at least it's working!

Thanks for persevering with me, Dale - it's much appreciated!


Re: Hyperlinks
"Dale Fye" <dale.fye[ at ]nospam.com> 12/24/2008 6:40:22 PM
Gavin,

If you know the application, you can probably get the hwind for it (google
that term along with VBA), and will probably be able to figure out a way to
make it open on top of Access.

Have a Merry Christmas

Dale

"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> wrote in message
news:wwu4l.183098$f82.126639[ at ]fe08.news.easynews.com...
[Quoted Text]
>
> "Dale Fye" <dale.fye[ at ]nospam.com> wrote in message
> news:esCmqmXZJHA.5272[ at ]TK2MSFTNGP04.phx.gbl...
>> gavin
>>
>> Have you checked to see whether it opened in the background (behind
>> Access)? I just ran that code in the immediate window of A2007, and it
>> flashed, then showed me the access window again. When I did Alt-Tab, it
>> showed me the Word document I had opened, with it visible.
>>
>> I'm not sure why it did not make word the active application. This is
>> the first time I've used that code in 2007, but it has worked great for
>> me in 2003, in the past.
>>
>> Dale
>>
>
> Hi Dale,
> That was exactly what was happening for me - the screen just flashed but
> Access was still the active Window - and the target document did not
> appear on the task bar. However, having tried this again and doing what
> you suggest, i.e. Alt-Tab, I find that the application is indeed open!
> Slightly odd behaviour - a minor bug? - but at least it's working!
>
> Thanks for persevering with me, Dale - it's much appreciated!
>


Re: Hyperlinks
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> 12/24/2008 10:03:41 PM

"Dale Fye" <dale.fye[ at ]nospam.com> wrote in message
news:OzghbcfZJHA.3844[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> Gavin,
>
> If you know the application, you can probably get the hwind for it (google
> that term along with VBA), and will probably be able to figure out a way
> to make it open on top of Access.
>
> Have a Merry Christmas
>
> Dale

Many thanks Dale - but having done a quick Google I fear that is above my
abilities - this group is called "gettingstarted" after all :-)

A very merry Christmas to you too!


Re: Hyperlinks
"Dirk Goldgar" <dg[ at ]NOdataSPAMgnostics.com.invalid> 12/25/2008 9:02:36 PM
"gavin" <theslider[ at ]cosmicdancer.freeserve.co.uk> wrote in message
news:0ly4l.145260$OS6.125719[ at ]fe01.news.easynews.com...
[Quoted Text]
>
> Many thanks Dale - but having done a quick Google I fear that is above my
> abilities - this group is called "gettingstarted" after all :-)


You might try the code posted here:

http://www.mvps.org/access/api/api0018.htm
API: Start an app with ShellExecute

Yes, it calls the Windows API, which can be a bit intimidating at first
sight, but all you have to do is copy all the code between the "** Code
Start **" and "** Code End **" comments into a new standard module, save
that module as, say, "modHandleFile", and then call the fHandleFile
function in your form's code like this:

fHandleFile "R:\..............\Thank you letter.pdf", WIN_NORMAL

That works for me, and brings the newly opened application to the front.
I'm not sure why FollowHyperlink is opening it in back, though, so please
let me know if the above method doesn't work for you.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net