Fire up IE7 by clicking hyperlink field?

D

DubboPete

Hi all,

Seems that setting a field's property to hyperlink isn't the simple
answer to make Internet Explorer fire up to that link at the OnClick
event.

Can someone please point out the correct code to use, or point me to
somewhere to find out?

TIA
DubboPete
 
D

DubboPete

Hi all,

Seems that setting a field's property to hyperlink isn't the simple
answer to make Internet Explorer fire up to that link at the OnClick
event.

Can someone please point out the correct code to use, or point me to
somewhere to find out?

TIA
DubboPete

Well, I had to do some extraneous research, and found the answer on a
site dedicated to Excel VBA! So here's what I did to fix my problem:

First, changed the underlying table's field [Cust_URL] to text (from
Hyperlink)
secondly, added this to the OnClick event of the field (should also
work with a command button):

Private Sub Cust_URL_Click()

Dim appIE As Object ' InternetExplorer
Dim sURL As String

Set appIE = CreateObject("InternetExplorer.Application")

sURL = Me.Cust_URL

With appIE
.Navigate sURL
.Visible = True
End With

Set appIE = Nothing

End Sub

It worked, so problem solved, and posted the resulting code so
everybody else can benefit from it.

If it doesn't work for you, it might not be cos you are on Win7,
Access2003 and IE8 :)

cheers DubboPete
 

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

Top