Web surfing in forms... (1 Viewer)

subzero

Registered User.
Local time
Today, 04:55
Joined
Mar 23, 2002
Messages
24
This might be a crazy idea, but i was wondering is it possible to make a web browser using Access forms? if so, how? and which object libraries should be turned on for the codes?
 

Graham T

Registered User.
Local time
Today, 04:55
Joined
Mar 14, 2001
Messages
300
Subzero

You can certainly include a web browser control in your forms using the Active X control (Microsoft Web Browser).

I'm not exactly which libraries need to be turned on for this to work, as the database I have it contained in automatically had everything set.

It then uses code in the On Current event property to display the website related to the customer (stored in the customers table)

Code:
Private Sub Form_Current()
    EnableIfNoNull
    
    'Navigate to the current record's Web site
    'If there's no URL stored in the field, then display default URL
    
    If Len([strWebsite]) > 0 Then
        wbbWebsite.Navigate URL:=[strWebsite]
    Else
        wbbWebsite.Navigate URL:="http://www.nitlc.com"
    End If
      
End Sub

HTH

Post back if you have any queries.

Graham
 

subzero

Registered User.
Local time
Today, 04:55
Joined
Mar 23, 2002
Messages
24
the computer doesn't recognise the Navigate command
 

expublish

Registered User.
Local time
Today, 04:55
Joined
Feb 22, 2002
Messages
121
Anyone know what references need to be turned on? I keep getting "Sub or function not defined" message with 'EnableIfNoNull' highlighted in yellow. I think this is because the reference is not enabled. Anyone help? Subzero,what did you do?
 

subzero

Registered User.
Local time
Today, 04:55
Joined
Mar 23, 2002
Messages
24
i didn't use Graham's codes, i used my own. What i tried to do was to see if i could make a web browser using Forms. This is what i did. btw i'm using Access 2000. Go to access design view and pull up toolbox, there at the bottom right cornor there should be a button called More Controls, click on it and go right down till u see Microsoft Web Browser. Click on that and then draw a big box on the form design base. I then made a text box for the URL and some buttons. Here are my exact codes:
Code:
Option Compare Database

Private Sub back_Click()
On Error Resume Next
'go to previous page
browser.GoBack
End Sub

Private Sub forward_Click()
On Error Resume Next
'go to next page
browser.GoForward
End Sub

Private Sub go_Click()
On Error Resume Next
'go to url button
browser.navigate (txturl)
End Sub

Private Sub browser_NavigateComplete()
On Error Resume Next
txturl.Text = browser.LocationURL
End Sub

Private Sub stop_Click()
On Error Resume Next
'stops the page from loading
browser.stop
End Sub
 

seany

Registered User.
Local time
Today, 04:55
Joined
Sep 1, 2003
Messages
53
Hi

Just wondering if you know how to perform a task on load of a new page in side the web browser

Thanks

Sean
 

Users who are viewing this thread

Top Bottom