-
1
- #1
VB6.0 Enterprise Edition. Trying to hyperlink to the interent does not work.
* Form1
TxtField(1) ... displays name
TxtField(2) ... displays URL
TxtField(3) ... linked using Adodc1. I click on > or >>| to see
what is next in line in my database.
CmdGo ......... press and the displayed URL website in
TxtField(2)should open in Internet Explorer
Add,Delete ... I also have Add, Delete and Update buttons since
I have a second form, Form2
* Form2 .... this is my database, Form2.mdb. I can add new names
and URLs to my database using this Add feature.
Here is the code behind CmdGo: 'Command Button
Private Sub cmdGo_Click()
On Error GoTo Errorhandler
Set Explorer = New SHDocVwCtl.InternetExplorer
Explorer.Visible = True
Explorer.Navigate txtField(2).Text
Exit Sub
Errorhandler:
MsgBox "Error displaying file for web site"
End Sub
I placed these lines in the Form Declarations:
Option Explicit
Dim varBookMark As Variant
Public Explorer As SHDocVwCtl.InternetExplorer
* No Hard-Coding the URL - Hard coding the URL into the program is NOT what I need. Doing that means having to constantly open the project, add the new URL, make a new EXE, and destroy the old one. What I am after, as you can see, is being able to Add new URLs constantly (which I am now doing)and then go to websites by clicking on the "GO" Command Button from my program. This should work, but I just don't know what is missing.
Can anyone help? Please be simple and specific with your suggestions and codes. Thank You.
* Form1
TxtField(1) ... displays name
TxtField(2) ... displays URL
TxtField(3) ... linked using Adodc1. I click on > or >>| to see
what is next in line in my database.
CmdGo ......... press and the displayed URL website in
TxtField(2)should open in Internet Explorer
Add,Delete ... I also have Add, Delete and Update buttons since
I have a second form, Form2
* Form2 .... this is my database, Form2.mdb. I can add new names
and URLs to my database using this Add feature.
Here is the code behind CmdGo: 'Command Button
Private Sub cmdGo_Click()
On Error GoTo Errorhandler
Set Explorer = New SHDocVwCtl.InternetExplorer
Explorer.Visible = True
Explorer.Navigate txtField(2).Text
Exit Sub
Errorhandler:
MsgBox "Error displaying file for web site"
End Sub
I placed these lines in the Form Declarations:
Option Explicit
Dim varBookMark As Variant
Public Explorer As SHDocVwCtl.InternetExplorer
* No Hard-Coding the URL - Hard coding the URL into the program is NOT what I need. Doing that means having to constantly open the project, add the new URL, make a new EXE, and destroy the old one. What I am after, as you can see, is being able to Add new URLs constantly (which I am now doing)and then go to websites by clicking on the "GO" Command Button from my program. This should work, but I just don't know what is missing.
Can anyone help? Please be simple and specific with your suggestions and codes. Thank You.