Results 1 to 2 of 2
  1. #1
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    161

    Using Web Browser in Access Form


    I have a form with an Active X Web Browser Control to display html files inside the control.
    When I set the Control Source using Properties to an html file, it shows e.g. ="D:\Home\Documents\Myfile.htm" in the Property.
    Running the application shows the html file correctly in the Web Browser Control.
    However, if I try to set the Control Source using VBA in code it does not work (WebBrowser1.ControlSource = "D:\Home\Documents\Myfile.htm"). It says the location is not valid when running the application.
    If I put = in (WebBrowser1.ControlSource = "=D:\Home|Documents\Myfile.htm"), this gives invalid syntax when running the application.

    Anyone know what I am doing wrong and how to correctly set the Control Source to an html file (on the computer) using VBA?

  2. #2
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    161
    OK,
    Just solved the problem myself. I needed to add a few more quotes in the syntax, so it should be WebBrowser1.ControlSource = "=""D:\Home\Documents\Myfile.htm"""

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-14-2017, 06:46 AM
  2. Replies: 9
    Last Post: 11-22-2015, 11:19 AM
  3. Web Browser control in access form
    By hilfesucher in forum Forms
    Replies: 1
    Last Post: 10-29-2015, 07:43 AM
  4. Replies: 1
    Last Post: 02-23-2015, 06:15 AM
  5. How to run an access form in web browser
    By developer8 in forum Access
    Replies: 1
    Last Post: 01-18-2014, 11:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums