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?
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
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?
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