Hyperlink field is too short

  • Thread starter Thread starter Ron van Oijen
  • Start date Start date
R

Ron van Oijen

Hi,

I am using MS Access 2003. I use a hyperlink field on a table for
storing hyperlinks to existing webpages on the internet. Many of the
URL's are longer than 255 characters, and these are getting truncated.
So when I click such a URL I get a CSP error message from the CSP
request object inspector, indicating that a run-time error occurred
while executing the page. URL's that are shorter than 255 characters
are executing just fine. According to the MS Access Help pages the
hyperlink field should be able to hold URL's up to 2048 characters
long, but that doesn't appear to be true. The problem is not with a
query, as I am executing the query right from the table. I have also
tried to store the URL's in a memo field, and then to execute them from
a form with the memo field control's hyperlink property set to yes.
This doesn't work either, as the URL gets truncated in exactly the same
way. I hope that someone can help me out, as I have been trying to
solve this problem for a long time.
 
Another good reason not to use the hyperlink data type.

Internally, a hyperlink field is a Memo type, with attributes set so it gets
special treatment. Clearly the 255-char limit does not apply to the entire
field, but it does appear that each part of the field is subject to this
limit. That is, the address is limited to 255-char, as is the display text,
etc.

I don't have a long link available to test, but you could see if
FollowHyperlink will accept a string in VBA that is longer than 255-char,
i.e. execute it in the Click event of the text box, without setting its
hyperlink property.
 
Hi Allen,

Unfortunately I don't know too much of VBA, so I can't figure out how
to apply your suggestion to my problem. Could you please make a
suggestion as to what the syntax should look like? The URL is stored in
a table field with the name "OB-address". The corresponding control on
the form has the name "URL".
 
Hi Allen,

I've found the solution! I did some searching on the internet, and
there I found the right syntax. I've adapted it to my own problem and
it seems to work perfectly now. This is my solution:

Private Sub URL_Click()
Application.FollowHyperlink Me.URL
End Sub

URL is the name of the control on the form where the hyperlinks are
retrieved from an underlying table.

Thanks!
 
Hi Allen,

Thanks to you I've found the solution! Following your suggestions I
could search around on the internet with the keyword FollowHyperlink.
There I found some clues to how to write a syntactically correct VBA
instruction. After some adaptation to my own situation it now seems to
work perfectly. This is my solution:

Private Sub URL_Click()
Application.FollowHyperlink Me.URL
End Sub

URL is the name of the control on the form where the hyperlinks are
retrieved from an underlying table. The URLs are stored in memo data
type fields inside that table.

I'm puzzled why Microsoft makes us work around the hyperlink data type
in order to have our hyperlinks execute properly. Right now the
hyperlink data type seems to be pretty useless in MS Access.

Thanks!
 
Back
Top