You can embed pretty much anything, as long as there is a related ActiveX control. In the form's design view, you can:
1. See your currently-"installed" controls via Tools->ActiveX Controls
2. Insert a control via Insert->ActiveX Control
Note that this is an awful pain for multiuser situations and differing installs. You will have to ensure all your users have the same control, and in many cases the same version of the control.
Ok. Here we go. Just follow these steps. When you type in Navigate as a method, it will not show up in the droplist. Don't panic.
Create a table with a field to store web addresses. Type some into your table. Create a form and at the top place a combo box bound(just use the Wizard) to this field with a label like:
Web Address [___________]. Name the combobox WebAddress. Next to it place a command button with the function ADD to allow the users to add new addresses to the table.
If you have Internet Explorer on your computer, you already have the Microsoft Web Browser Control (an ActiveX control). (you know, these are written by X-Men).
1) Go to design view of the form. Click on Insert, ActiveX Control.
2) Select Microsoft Web Browser Control. Click OK. Reposition the control so it doesn't hide the combo box. Resize it with the little squares (sizing handles) so it fills the rest of the form.
3) Bring up it's property sheet. Change the name, call it BrowserControl.
Now you need to write some code. You will use the Navigate method of the control to display a web site.
1) Select the whole form (upper square left hand corner). On the forms property sheet, click on the OnLoad event, click on the build button, select code builder. Type the following:
Private Sub Form_Load() 'don't have to type this
BrowserControl.Navigate "
So, when the form opens it will have a site already there.
Return to your form.
Click the Web Address combo box. Bring up its property sheet. Click on the AfterUpdate event, click on the build button, select Code builder.
Type the following line between the Sub and End Sub:
BrowserControl.Navigate WebAddress
It will now navigate to the web address either selected by the dropdown arrow or typed in by the user.
There's alot more you can do by coding, by I grow weary.
I'm not sure what you mean by the border. But do this and see if it helps. Set the following on your FORM properties:
NavigationButtons to No
ViewsAllowed to Form
ScrollBars to Neither
RecordSelectors to No
AutoCenter to Yes
BorderStype to Thin
I believe the instructions you gave me refer to the form. I inserted the Web Browser ActiveX control on my form. It comprises a small rectangular area on my form. I can then view an html file within the Web Browser. The problem is that the Web Browser ActiveX control has a border around it. I can make the border so that it is raised, sunken, etc. But I can't make it invisible. I've searched the internet and can't seem to find a solution. Any ideas?
This will, if you pass in a standard web link, open up your web browser to the page. It is browser-independent, I believe (not tested). It is also "ActiveX control"-free; maybe this is a bigger bonus for me than for others.
Mr/Ms (made that mistake once so I take no chances) Foolio12,
Yeah, that's a good way too. But I guess I could say "It still has a border." like the one I'm typing in now. So, I dunno. Sounds like a social statement - "No Borders! No Borders!"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.