By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,482 Members | 2,438 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,482 IT Pros & Developers. It's quick & easy.

FOr some reason my hyperlink is not working.

P: n/a
I have a form with a Command button. i have a text box also which is
bound to my
Button. i have created a standard module and created an onclick event
for my button
which is something like this ( if a user clicks on the button it will
give an option
to the user to add a file. The Path of that file will be copied to the
textbox which is associated
to my control or button.) i changed the data type also for my textbox
to
Hyperlink so then
when a user clicks on that path which is in the textbox it will
automatically open that document. Well for
some reason it is not working may be i am doing something wrong. any
help or suggestions will be really appreciated.
Thanks

Jul 12 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
su********@gmail.com wrote:
I have a form with a Command button. i have a text box also which is
bound to my
Button. i have created a standard module and created an onclick event
for my button
which is something like this ( if a user clicks on the button it will
give an option
to the user to add a file. The Path of that file will be copied to the
textbox which is associated
to my control or button.) i changed the data type also for my textbox
to
Hyperlink so then
when a user clicks on that path which is in the textbox it will
automatically open that document. Well for
some reason it is not working may be i am doing something wrong. any
help or suggestions will be really appreciated.
Thanks
I like http://www.mvps.org/access/api/api0001.htm for getting a
file/open dialog box to pick the file.

And I prefer http://www.mvps.org/access/api/api0018.htm to using
hyperlinks. Now, I will store a value to a hyperlink field. Ex:
rst!Hyper = "Hit Me#C:\Test\Bonk.JPG"
however, I'll break the two using HyperLinkPart. I'll display the Hit
Me in a text field and the file name in a hidden field. Then I call the
API018 routine to open the file. I like it because I can make it a
dbl-click event.

In your case you might want to check out FollowHyperLink or Follow in
help. I'm not sure how you changed the text box to hyperlink, better
you changed the table's field type to Hyperlink.
Jul 13 '06 #2

P: n/a
hi salad
Thanks for the reply. well i used the same function for open/save
dialog and then created an onclick procedure for my button :

Private Sub AddaFile_Click()
Me.YourTextBoxName = GetOpenFile(CurrentProject.Path, "Select Source
File")
End Sub

and then i created one more onclick procedure for my textbox which was
something like this:

Private Sub Attachments_Click()
Application.FollowHyperlink (Attachments & "#" & txtLOC & "#")
End Sub

it work fine for me now. came to know that for some reason you need to
have a # sign at the begining and at the end. but i will try tomorrow
the hyperlink function you posted so then i can learn more about it.
Thanks for the reply.
salad wrote:
su********@gmail.com wrote:
I have a form with a Command button. i have a text box also which is
bound to my
Button. i have created a standard module and created an onclick event
for my button
which is something like this ( if a user clicks on the button it will
give an option
to the user to add a file. The Path of that file will be copied to the
textbox which is associated
to my control or button.) i changed the data type also for my textbox
to
Hyperlink so then
when a user clicks on that path which is in the textbox it will
automatically open that document. Well for
some reason it is not working may be i am doing something wrong. any
help or suggestions will be really appreciated.
Thanks
I like http://www.mvps.org/access/api/api0001.htm for getting a
file/open dialog box to pick the file.

And I prefer http://www.mvps.org/access/api/api0018.htm to using
hyperlinks. Now, I will store a value to a hyperlink field. Ex:
rst!Hyper = "Hit Me#C:\Test\Bonk.JPG"
however, I'll break the two using HyperLinkPart. I'll display the Hit
Me in a text field and the file name in a hidden field. Then I call the
API018 routine to open the file. I like it because I can make it a
dbl-click event.

In your case you might want to check out FollowHyperLink or Follow in
help. I'm not sure how you changed the text box to hyperlink, better
you changed the table's field type to Hyperlink.
Jul 14 '06 #3

P: n/a
su********@gmail.com wrote:
hi salad
Thanks for the reply. well i used the same function for open/save
dialog and then created an onclick procedure for my button :

Private Sub AddaFile_Click()
Me.YourTextBoxName = GetOpenFile(CurrentProject.Path, "Select Source
File")
End Sub

and then i created one more onclick procedure for my textbox which was
something like this:

Private Sub Attachments_Click()
Application.FollowHyperlink (Attachments & "#" & txtLOC & "#")
End Sub

it work fine for me now. came to know that for some reason you need to
have a # sign at the begining and at the end. but i will try tomorrow
the hyperlink function you posted so then i can learn more about it.
Thanks for the reply.
salad wrote:
>>su********@gmail.com wrote:
GREAT!

Now here's an issue. I was grabbing info, let's say a subject line, for
the link's display text. Something like
"Progress Report" and the filename was
C:\Test\Job# 123.Txt
Guess what? That # invalidated my hyperlink. I knew that asking people
to not include # in filenames would be futile. So I wrote a routine to
strip out # in filenames and would copy the filename to the newfile name
without #. Then I could do the "Hit Me#Job 123.txt#" for the hyperlink.

Basically, hyperlinks are a modified memo file (read this from Michael
Kaplan) and the # symbol was used to delineate the display text, the
file name, and range. So make sure you aren't using #'s in filenames.

Jul 14 '06 #4

P: n/a
Thanks alot got it. God wasted 4 days to figure it what i was doing
wrong :).
Thanks salad
salad wrote:
su********@gmail.com wrote:
hi salad
Thanks for the reply. well i used the same function for open/save
dialog and then created an onclick procedure for my button :

Private Sub AddaFile_Click()
Me.YourTextBoxName = GetOpenFile(CurrentProject.Path, "Select Source
File")
End Sub

and then i created one more onclick procedure for my textbox which was
something like this:

Private Sub Attachments_Click()
Application.FollowHyperlink (Attachments & "#" & txtLOC & "#")
End Sub

it work fine for me now. came to know that for some reason you need to
have a # sign at the begining and at the end. but i will try tomorrow
the hyperlink function you posted so then i can learn more about it.
Thanks for the reply.
salad wrote:
>su********@gmail.com wrote:

GREAT!

Now here's an issue. I was grabbing info, let's say a subject line, for
the link's display text. Something like
"Progress Report" and the filename was
C:\Test\Job# 123.Txt
Guess what? That # invalidated my hyperlink. I knew that asking people
to not include # in filenames would be futile. So I wrote a routine to
strip out # in filenames and would copy the filename to the newfile name
without #. Then I could do the "Hit Me#Job 123.txt#" for the hyperlink.

Basically, hyperlinks are a modified memo file (read this from Michael
Kaplan) and the # symbol was used to delineate the display text, the
file name, and range. So make sure you aren't using #'s in filenames.
Jul 15 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.