Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   Courses   Seminars   Templates   Help   TechHelp   Forums   Contact   Join   Order   Logon  
 
Tips & Tricks

New Tips Added Weekly!
Click here to get on our Mailing List

   
 
MS Access

Web Browser Control

How to navigate to a different URL based on a subform value

In this tutorial I will explain how to navigate to a URL based on a Subform value.

There was a question on the Forum asking how to update a Web Browser Control with values from a SubForm.

I've created a simple Table with some dummy data, made a continuous Form from that then added it as a Subform to another Form.

This Main Form has a Web Browser Control (WebBrowser1) and an unbound Textbox (URL)

There's a Tip talking about referencing controls.

=Forms!CustomerF!CustomerID
=Forms!CustomerF!OrderSubForm.Form!OrderTotal
=Forms!FormName!FieldName
=Forms!ParentForm!SubForm.Form!FieldName

In this case we are on the Subform and want to update on the Parent so we can use the Parent keyword.

Form_Current()

	Private Sub Form_Current()
		MsgBox ID
		Dim strURL
		strURL = "https://www.google.co.uk/?q=" & ID
		Me.Parent.URL = strURL
		Me.Parent.WebBrowser1.Object.Navigate strURL
	End Sub
	

Let me know if you'd like any additions.

Sample Files
WebBrowser.accdb (Access 2010 .accdb)


 

Alex Hedley (Avatar) By: Alex Hedley


Click here to sign up for more FREE tips

 

You may want to read these articles from the 599CD News:

 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn