Hyperlinks in a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I posed this question a couple of days ago and got no response. Can someone
help.

I have a multiple user database that the user inputs data in through a form.
One question the form is: What is the name of your file saved on the
server." They put in for example: Fairburn Rd. This is saved in the
"location" field in the "Work Order" table as a hyperlink.

Through a query, I have brought together this field and my path to the file;
e.g., "c:\mydocuments\fairburn rd.pdf".

Through the report form, I want to display this as a hyperlink. I have
chosen the "ishyperlink" for this field of the form. When displaying the
form it looks like a hyperlink but it does not open the link.

What can I do to make this all work, is there a better easier way?

thanks
 
To create something that behaves as a hyperlink, you would need to add the
two # delimiters within the field:
#c:\mydocuments\fairburn rd.pdf#

Alternatively, you could code the Click event with FollowHyperlink.
 
Allen,

Thank you for responding. I tried your solution in my query but I get an
error that says, "The expression you entered has an invalid date value".

This is the exact formula that I am using that works to bring everything
together:

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg","")

Here is the formula that I added the # to but I get the error message above:
Test: IIf([GIS_ Map_ Link]<>"",#"C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg"#,"")

Can you tell me what I am doing wrong on the last formula where I add the #?
Once I get this formula worked out, will the result be a hyperlink?

thank you
TV
 
Okay, that's funny. Access uses # as a delimiter for dates, an so is
misunderstanding the value.

You could circumvent that by repeating the link for the display text before
the first #, i.e.:
c:\mydocuments\fairburn rd.pdf#c:\mydocuments\fairburn rd.pdf#

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

tv said:
Allen,

Thank you for responding. I tried your solution in my query but I get an
error that says, "The expression you entered has an invalid date value".

This is the exact formula that I am using that works to bring everything
together:

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg","")

Here is the formula that I added the # to but I get the error message
above:
Test: IIf([GIS_ Map_ Link]<>"",#"C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg"#,"")

Can you tell me what I am doing wrong on the last formula where I add the
#?
Once I get this formula worked out, will the result be a hyperlink?

Allen Browne said:
To create something that behaves as a hyperlink, you would need to add
the
two # delimiters within the field:
#c:\mydocuments\fairburn rd.pdf#

Alternatively, you could code the Click event with FollowHyperlink.
 
Allen,

I tried what you explained in my test formula where I bring the two cells
together but is still does not work. I still get an error message. Can you
show me in this formula how you would do this? I am afraid I may doing this
wrong.

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg","")


thank you
tv
--
tv


Allen Browne said:
Okay, that's funny. Access uses # as a delimiter for dates, an so is
misunderstanding the value.

You could circumvent that by repeating the link for the display text before
the first #, i.e.:
c:\mydocuments\fairburn rd.pdf#c:\mydocuments\fairburn rd.pdf#

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

tv said:
Allen,

Thank you for responding. I tried your solution in my query but I get an
error that says, "The expression you entered has an invalid date value".

This is the exact formula that I am using that works to bring everything
together:

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg","")

Here is the formula that I added the # to but I get the error message
above:
Test: IIf([GIS_ Map_ Link]<>"",#"C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg"#,"")

Can you tell me what I am doing wrong on the last formula where I add the
#?
Once I get this formula worked out, will the result be a hyperlink?

Allen Browne said:
To create something that behaves as a hyperlink, you would need to add
the
two # delimiters within the field:
#c:\mydocuments\fairburn rd.pdf#

Alternatively, you could code the Click event with FollowHyperlink.

I posed this question a couple of days ago and got no response. Can
someone
help.

I have a multiple user database that the user inputs data in through a
form.
One question the form is: What is the name of your file saved on the
server." They put in for example: Fairburn Rd. This is saved in the
"location" field in the "Work Order" table as a hyperlink.

Through a query, I have brought together this field and my path to the
file;
e.g., "c:\mydocuments\fairburn rd.pdf".

Through the report form, I want to display this as a hyperlink. I have
chosen the "ishyperlink" for this field of the form. When displaying
the
form it looks like a hyperlink but it does not open the link.
 
What is GIS_Map_Link? If it is a field, could it be Null?

You can try:
Test: IIf([GIS_ Map_ Link] Is Null, Null,
"C:\Test\Bridge Maint\GIS Maps\" & [GIS_Map_ Link] & ".jpg#" &
"C:\Test\Bridge Maint\GIS Maps\" & [GIS_Map_ Link] & ".jpg#")

Alternatively, just put something into the Click (or DblClick) event of the
text box on your form to make it behave like a hyperlink:

Private Sub GIS_Map_Link_Click()
If Not IsNull(Me.GIS_Map_Link) Then
FollowHyperlink "C:\Test\Bridge Maint\GIS Maps\" + [GIS_Map_ Link] +
".jpg"
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

tv said:
Allen,

I tried what you explained in my test formula where I bring the two cells
together but is still does not work. I still get an error message. Can you
show me in this formula how you would do this? I am afraid I may doing
this
wrong.

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg","")


thank you
tv
--
tv


Allen Browne said:
Okay, that's funny. Access uses # as a delimiter for dates, an so is
misunderstanding the value.

You could circumvent that by repeating the link for the display text
before
the first #, i.e.:
c:\mydocuments\fairburn rd.pdf#c:\mydocuments\fairburn rd.pdf#

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

tv said:
Allen,

Thank you for responding. I tried your solution in my query but I get
an
error that says, "The expression you entered has an invalid date
value".

This is the exact formula that I am using that works to bring
everything
together:

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" &
([GIS_
Map_ Link]) & ".jpg","")

Here is the formula that I added the # to but I get the error message
above:
Test: IIf([GIS_ Map_ Link]<>"",#"C:\Test\Bridge Maint\GIS Maps\" &
([GIS_
Map_ Link]) & ".jpg"#,"")

Can you tell me what I am doing wrong on the last formula where I add
the
#?
Once I get this formula worked out, will the result be a hyperlink?

:

To create something that behaves as a hyperlink, you would need to add
the
two # delimiters within the field:
#c:\mydocuments\fairburn rd.pdf#

Alternatively, you could code the Click event with FollowHyperlink.

I posed this question a couple of days ago and got no response. Can
someone
help.

I have a multiple user database that the user inputs data in through
a
form.
One question the form is: What is the name of your file saved on the
server." They put in for example: Fairburn Rd. This is saved in
the
"location" field in the "Work Order" table as a hyperlink.

Through a query, I have brought together this field and my path to
the
file;
e.g., "c:\mydocuments\fairburn rd.pdf".

Through the report form, I want to display this as a hyperlink. I
have
chosen the "ishyperlink" for this field of the form. When
displaying
the
form it looks like a hyperlink but it does not open the link.
 
Allen,

Your first suggestion worked. However, there were 3 pdfs that would not
pull up. The files are named the same, when I use your formula to pull the
field from the table, the formula works fine. However, when I use the button
that I have created on the form to pull these 3 up, I get an error message of
"Unable to open file C:\Test\Bridge Maint\GIS Maps\fairburn rd.pdf. Cannot
open the specified file."

These 3 files are named exactly the same as the ofther 50 that open fine.
Do you know what could possibly be stopping them from opening?

Thanks for your help...You are a genius.
Tv
--
tv


Allen Browne said:
What is GIS_Map_Link? If it is a field, could it be Null?

You can try:
Test: IIf([GIS_ Map_ Link] Is Null, Null,
"C:\Test\Bridge Maint\GIS Maps\" & [GIS_Map_ Link] & ".jpg#" &
"C:\Test\Bridge Maint\GIS Maps\" & [GIS_Map_ Link] & ".jpg#")

Alternatively, just put something into the Click (or DblClick) event of the
text box on your form to make it behave like a hyperlink:

Private Sub GIS_Map_Link_Click()
If Not IsNull(Me.GIS_Map_Link) Then
FollowHyperlink "C:\Test\Bridge Maint\GIS Maps\" + [GIS_Map_ Link] +
".jpg"
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

tv said:
Allen,

I tried what you explained in my test formula where I bring the two cells
together but is still does not work. I still get an error message. Can you
show me in this formula how you would do this? I am afraid I may doing
this
wrong.

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" & ([GIS_
Map_ Link]) & ".jpg","")


thank you
tv
--
tv


Allen Browne said:
Okay, that's funny. Access uses # as a delimiter for dates, an so is
misunderstanding the value.

You could circumvent that by repeating the link for the display text
before
the first #, i.e.:
c:\mydocuments\fairburn rd.pdf#c:\mydocuments\fairburn rd.pdf#

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Allen,

Thank you for responding. I tried your solution in my query but I get
an
error that says, "The expression you entered has an invalid date
value".

This is the exact formula that I am using that works to bring
everything
together:

Test: IIf([GIS_ Map_ Link]<>"","C:\Test\Bridge Maint\GIS Maps\" &
([GIS_
Map_ Link]) & ".jpg","")

Here is the formula that I added the # to but I get the error message
above:
Test: IIf([GIS_ Map_ Link]<>"",#"C:\Test\Bridge Maint\GIS Maps\" &
([GIS_
Map_ Link]) & ".jpg"#,"")

Can you tell me what I am doing wrong on the last formula where I add
the
#?
Once I get this formula worked out, will the result be a hyperlink?

:

To create something that behaves as a hyperlink, you would need to add
the
two # delimiters within the field:
#c:\mydocuments\fairburn rd.pdf#

Alternatively, you could code the Click event with FollowHyperlink.

I posed this question a couple of days ago and got no response. Can
someone
help.

I have a multiple user database that the user inputs data in through
a
form.
One question the form is: What is the name of your file saved on the
server." They put in for example: Fairburn Rd. This is saved in
the
"location" field in the "Work Order" table as a hyperlink.

Through a query, I have brought together this field and my path to
the
file;
e.g., "c:\mydocuments\fairburn rd.pdf".

Through the report form, I want to display this as a hyperlink. I
have
chosen the "ishyperlink" for this field of the form. When
displaying
the
form it looks like a hyperlink but it does not open the link.
 
No idea why some are working and not others.
The difference is not the spaces in the field/path names?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

tv said:
Allen,

Your first suggestion worked. However, there were 3 pdfs that would not
pull up. The files are named the same, when I use your formula to pull the
field from the table, the formula works fine. However, when I use the
button
that I have created on the form to pull these 3 up, I get an error message
of
"Unable to open file C:\Test\Bridge Maint\GIS Maps\fairburn rd.pdf. Cannot
open the specified file."

These 3 files are named exactly the same as the ofther 50 that open fine.
Do you know what could possibly be stopping them from opening?

Thanks for your help...You are a genius.
Tv
--
tv


Allen Browne said:
What is GIS_Map_Link? If it is a field, could it be Null?

You can try:
Test: IIf([GIS_ Map_ Link] Is Null, Null,
"C:\Test\Bridge Maint\GIS Maps\" & [GIS_Map_ Link] & ".jpg#" &
"C:\Test\Bridge Maint\GIS Maps\" & [GIS_Map_ Link] & ".jpg#")

Alternatively, just put something into the Click (or DblClick) event of
the
text box on your form to make it behave like a hyperlink:

Private Sub GIS_Map_Link_Click()
If Not IsNull(Me.GIS_Map_Link) Then
FollowHyperlink "C:\Test\Bridge Maint\GIS Maps\" + [GIS_Map_
Link] +
".jpg"
End If
End Sub
 
Back
Top