Hyperlink problem

  • Thread starter Thread starter Elaine
  • Start date Start date
E

Elaine

Hi guys, I'm having problems with hyperlinks. A textbox's IsHyperlink
property is set to yes, but when clicking , it duplicates the address and
adds the # sign. Ex.:
www.bbc.co.uk, becomes,
www.bbc.co.uk#http://www.bbc.co.uk#

and it becomes unclickable.....

Does anybody know if there's a solution for this?

many thanks

Elaien
 
Hi Elaine

Don't set the format on the form.

Set the field's format in the table as Hyperlink. Ensure you include
http://www at the start of the hyperlink in the field. For e mails start
with MailTo:

Open the form in design view and delete the field and then view field list
and drag the field again from the list into the form where you want it. View
normal and it should work.

Hope this helps

--
Wayne
Manchester, England.
Enjoy whatever it is you do
Scusate,ma il mio Inglese fa schiffo :-)
Percio se non ci siamo capiti, mi mandate un
messagio e provero di spiegarmi meglio.
 
Hi Elaine,

Personally, I prefer to avoid the use of the hyperlink data type, if at all
possible. If all of your hyperlinks are less than 255 characters, the maximum
for a text data type, then just use a text field set to it's maximum size
(255 characters). An example of a double-click event procedure for a text box
on a form would be the following. The name of the text box control is
"txtWebPage". I prefer using the double-click event procedure, because this
allows you to easily click into the text box to edit the data, without firing
off the code.


Option Compare Database
Option Explicit

Private Sub txtWebPage_DblClick(Cancel As Integer)
On Error GoTo ProcError

Dim strHyperlink As String
strHyperlink = Me.txtWebPage.Text

If Left$(strHyperlink, 7) <> "http://" Then
strHyperlink = "http://" & strHyperlink
End If

Application.FollowHyperlink strHyperlink

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure txtWebPage_DblClick..."
Resume ExitProc
End Sub



Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Dear Tom.

Many thanks, it works perfectly. I will probably not have any links other
than http:// ones anyway.

Kind regards,

Elaine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top