Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Web browser within access form (2003)

    Hi all,

    Does anyone know how to put a web browser within an access form. I have inserted a Microsoft web browser object, but don't know how to use it.

    I would like to be able to set a default homepage, and have am address bar to go to other URL's

    Many thanks
    Regards
    Gerbil (AKA Kevin)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Web browser within access form (2003)

    You can use VBA code to load a page. For example:

    Private Sub Form_Load()
    Dim strWebAddress As String
    ' Default page
    strWebAddress = "http://www.google.com"
    Me.WebBrowser0.Navigate2 strWebAddress
    End Sub

    Private Sub Command1_Click()
    Dim strWebAddress As String
    strWebAddress = Me.txtAddress
    Me.WebBrowser0.Navigate2 strWebAddress
    End Sub

    Here, WebBrowser0 is the web browser control, Command1 is the "Load" or "Go" command button, and txtAddress is the text box in which the user can enter a web address.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Web browser within access form (2003)

    I have attached a small database demonstrating the use of a web browser control.
    Attached Files Attached Files

  4. #4
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web browser within access form (2003)

    Thanks Hans this works quite well. Just a few problems with it that I can't understand. 1) I cant use the enter key. For example type something into google and pressing enter to search, and typing this reply I cant enter to new lines. 2) I cant display pages on our intranet I get a page not displayed message. All external sites are fine. Thanks again
    Regards
    Gerbil (AKA Kevin)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Web browser within access form (2003)

    If you set the Default property of the command button to Yes (it's in the Other tab of the Properties window), pressing Enter in the text box will have the same effect as clicking the button.

    I don't know why the control won't display intranet pages, sorry.

  6. #6
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web browser within access form (2003)

    Thanks Hans, I think the intranet is blocked as it does see it as a web-browser. Cant get the enter key to work i dont have a button. I put the code on the after update event of the text box. It's within the browser window thats the problem. Not having the enter key working makes it hard to type on online forms etc. Thanks Hans
    Regards
    Gerbil (AKA Kevin)

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Web browser within access form (2003)

    This is probably a naive question, but why do you want to use the webbrowser control? Wouldn't it be easier if the user just started his or her browser?

  8. #8
    3 Star Lounger
    Join Date
    Jul 2008
    Location
    Suffolk, United Kingdom
    Posts
    308
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Web browser within access form (2003)

    It would and I am just playing around really learning as I go. There is no real need to have it but... I have been developing a database which runs everything I need within one program, email, calendar, internet, links to other database, documents etc.

    A one-stop-database for everything I use every day.

    Kevin
    Regards
    Gerbil (AKA Kevin)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •