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

Dynamic hyperlink in form

P: 3
hi i'm trying to figure out how to have a hypertext link in a form use the information entered from a separate field in order to link to a word document

Link to Report is a hyperlink that gets the Medical Record # from another field and uses that to link to "[Medical Record #].doc" so that when a patient's Medical Record # is entered as 0001, the hyperlink will open "0001.doc" and so forth

will i have to use code builder to DoCmd a copy object?
or can i use some sort of simplified language in the Hyperlink Address properties (ie: [Medical Record #].doc)?

your help is greatly valued and appreciated!
Oct 10 '06 #1
Share this Question
Share on Google+
3 Replies

P: 3
ok i'll answer my own post for s&gigs
in case some googlers come round asking the same question...

I right clicked the text i wanted to use as a hyperlink, clicked Build Event... then Code Builder
then i entered this VBA code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Link_Label_Click()
  2. Dim strfile As String
  3. strfile = Me.controlname + ".doc"
  4. Application.FollowHyperlink strfile
  5. End Sub
good luck to all
Oct 11 '06 #2

P: 3
i just found this 9 years later after trying to remember how i did this 9 years ago...

Nov 12 '15 #3

Expert Mod 5K+
P: 5,397
Nice to have that information available.
In fact, I just did the same thing here, I posted an answer a while back (has it been that long - yikes!) and ran into a similar issue and couldn't remember how I had solved it, nor find my notes... but I did remember I had posted here... and there it was! Bytes has been a real time saver and education!
Nov 12 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.