Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you embed a browser in a form 1

Status
Not open for further replies.

PerryG

Programmer
Aug 15, 2000
75
0
0
US
Using Access 2000.....never tried this and it seems information is limited.

Thanks.
 
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.

--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
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 "End Sub

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.

Neil
 
Neil, how do I remove/hide the border around the ActiveX control "Microsoft Web Browser"?
 
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

Then max your form.

Neil
 
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?
 
I dunno. How about go into design view, click on the control and on its property sheet for Border Style make it Transparent?

Beyond that, make your control the same size as your form.

The form is a container. If you have water in a clear glass, you still see the rim.

I'm stumped.

Neil
 
If you want a huge workaround, you can instead of including a control, open the
Code:
[URL unfurl="true"]http://www.com.etc/[/URL]
address via an API call:



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.

--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
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!"

Whatevcr happened to PerryG?

Hope foolio12's answer is the answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top