Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Amy B's Avatar
    Amy B is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Santa Barbara, CA
    Posts
    9

    Back button error on web browser

    Hi everyone,


    I'm trying to code a back button in a web browser, but I'm getting a compile error - 'expected end of statement'. Here is the code:

    Private Sub cmdBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBack.Click
    webBrowser.GoBack
    End Sub


    The error message highlights the word "Handles." Can anyone tell me why this is happening?

    Ty for your help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    This is something new to me. How did you figure out that code? Is there a web reference?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Amy B's Avatar
    Amy B is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Santa Barbara, CA
    Posts
    9
    Hi June7,

    Since you are a moderator, I think it's ok for me to tell you this. I found the code demonstrated in two YouTube videos:
    #1:www.youtube.com/watch?v=7jwsltHCqyg
    #2:www.youtube.com/watch?v=2njcFb3Dajw

    But as I said above, I'm getting an error message. Any idea why?

    AB

  4. #4
    Amy B's Avatar
    Amy B is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Santa Barbara, CA
    Posts
    9
    Hi June7,

    I found it demonstrated in two u-tube videos online. I tried to post the links here but it seems to be blocked. As I said, I'm getting an error message when I run the code behind my back button. Any idea why?

    AB

  5. #5
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Hi, AB
    But this is a special code language VB.Net
    Not VBA
    http://www.homeandlearn.co.uk/NET/vbNet.html

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    The links work. I just have frustration trying to view YouTube on my laptop.

    Were the tutorials Access specific?

    I see azhar already determined the demos are VB.net. VB.net is not directly transferrable to VB or VBA. The web browser control in Access might not be capable of true web navigation. The control has a ControlSource property that determines the web link.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Amy B's Avatar
    Amy B is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Santa Barbara, CA
    Posts
    9
    Darn! I was afraid that the problem might be a VB version issue, but I didn't realize that it was a different (albeit similar) code language! So when you say Access might not be capable of true web navigation, does that mean a back button isn't possible on an Access web browser?

    AB

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That's what I am seeing.

    WebBrowserControl allows displaying web page within Access form as opposed to opening in an external web browser window with FollowHyperlink.

    The ControlSource can be set to a table field that has URL links. Navigate the records to change the web page.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    AB
    Of course each language its own rules
    I've explained to you professor June7 Thread

  10. #10
    Amy B's Avatar
    Amy B is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Santa Barbara, CA
    Posts
    9
    I think I understand what you are both saying. So if a back button isn't possible, is there a way to refresh or reset the browser without closing and reopening the form? I'm using the browser to display folders on a network. If the user opens a folder, they will sometimes need to go back to open a different folder.

    AB

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That would be setting the ControlSource property. Where are the folder paths coming from?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    Amy B's Avatar
    Amy B is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Santa Barbara, CA
    Posts
    9
    The current ControlSource property of the web browser is:

    =\\Data\Admin\Library\" & Year([txtClose]) & "\" & [txtLibrary]

    ...which uses a couple of fields on the form to complete the path.

    AB

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Then the control is dynamic by referencing field from table? The form is bound to the table? Navigate records and the web browser control should reflect the change.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    Amy B's Avatar
    Amy B is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Location
    Santa Barbara, CA
    Posts
    9
    Yes. The control references a field from the table that the form is bound to. Could you explain "Navigate records and the web browser control should reflect the change"?

    AB

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I mean exactly that. Use the intrinsic Access record navigation bar at bottom of form to move between records. Data of the current record should be reflected in controls on the form. The web browser control is just another control with a ControlSource, like a textbox.

    Can have a custom button and code to replicate this movement between records.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-21-2012, 08:21 AM
  2. Button linking back to form?
    By Raygar in forum Reports
    Replies: 1
    Last Post: 05-14-2012, 06:26 PM
  3. #NAME? Error keeps coming back
    By tharless in forum Access
    Replies: 24
    Last Post: 02-09-2012, 03:10 PM
  4. BACK BUTTON Not Working
    By HENRYM in forum Forms
    Replies: 5
    Last Post: 01-19-2012, 03:16 PM
  5. Replies: 2
    Last Post: 12-08-2011, 02:27 PM

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