Folder navigation on a Web Browser Control

Brando

Enthusiastic Novice
Local time
Today, 06:20
Joined
Apr 4, 2006
Messages
100
Greetings,

In an Access 2010 db, I have a Web Browser Control that displays the contents of a network folder.

="\\Net1\Data\Clients\ClientFiles\"

As the user clicks on subfolders in the browser, they may have the need to go back (up) to a previous folder. I need a "back" button. Is it possible to code a command button to control the browser this way?

Thank you in advance.
 
Maybe have a variable that stores the current path, then, when you move to the next path you first assign the old one?
 
I'm still struggling with this. The Web Browser is named webElf. While viewing webElf, the user doubleclicks to open one of the subfolders in \\Net1\Data\Clients\ClientFiles\ and then may want to go back up to \\Net1\Data\Clients\ClientFiles\. It seems like something like this should reset the browser...
___________________________________________
Private Sub cmdBackward_Click()

Me.webElf.ControlSource = "\\Net1\Data\Clients\ClientFiles\"

End Sub
___________________________________________

But it does nothing. No change to the web browser, no errors, nada. I also tried webElf = "\\Net1\Data\Clients\ClientFiles\". Also nothing. Any more thoughts?

Brando
 
Hmmm.... Gooooogle... It sounds familiar.

Anyway, I went to the link, but I can't find the event in the VB window called "BeforeNavigate2"? I don't suppose that's the same thing as "OnBeforeNavigate"?
 
I'm learning a lot in my research, but still not having success. My current endeavor is the simplest attempt so far...
______________________________
Private Sub cmdBack2_Click()

webElf2.GoBack

End Sub
______________________________

But I'm getting a compile error: 'Method or data member not found." It doesn't seem to like the .GoBack. Many postings say it should work. What am I missing?

Thank you,

Brando
 
Maybe Me.webElf2.GoBack ????? (guess)

I had similar and used these
(you can see my browser name was brwMyShip)

Code:
Private Sub cmdBack_Click()
On Error Resume Next
  Me.brwMyShip.GoBack
End Sub

Private Sub cmdForward_Click()
On Error Resume Next
   Me.brwMyShip.GoForward
End Sub

Private Sub cmdGoogle_Click()
On Error Resume Next
Me.brwMyShip.Navigate "www.google.com"
End Sub

Private Sub cmdRefresh_Click()
On Error Resume Next
 Me.brwMyShip.Refresh
End Sub

Private Sub cmdStop_Click()
On Error Resume Next
 Me.brwMyShip.Stop
End Sub

Private Sub Form_Current()
'
'I added this to try to stop the web page script errors
'but it has no effect. Script errors still occur.
'It's an issue with Digital-seas and IE not Access
DoCmd.SetWarnings False
End Sub
 
Thank you for the thought. I have tried that with no success. Why would it give me that compile error and highlight ".GoBack"? Am I missing a library reference or have a flaw in my project? I'm really scratching my head. Even I think this is simple! Geez!
 
After an avalanche of web searches and YouTube videos, I have learned that the following is the proper code for creating a back button:
____________________________________
Private Sub cmdBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBack.Click
webElf.GoBack
End Sub
____________________________________

However, it still doesn't work on my form. Could it be a program version issue?
I'm using:
- Access - version 14 (Office 2010)
- Windows 7
- VB for Apps 7

I'm at my wits end. Any experience with this is appreciated.

Brando
 
Last edited:
One last try.

When I run the code above, I get a Compile error (Expected: end of statement) and it highlights the word "Handles".

Once again, thank you in advance for any help.
 
Good news! After weeks of postings and research, I have figured out a way to code a back button! It's not elegant, but it does the job.

Here is the code:

Code:
Private Sub cmdBack_Click()

Dim strCS As String
Dim strCS2 As String

    strCS = "=(""\\Files\Admin\Library\" & """)"
    strCS2 = "=(""\\files\Admin\Library\" & Year([txtClose]) & "\" & [txtLibrary] & """)"

    Me.webElf.ControlSource = strCS
   
        Me.webElf.ControlSource = strCS2

        
End Sub

Basically, in order to send the browser back to the starting point, I had to first change it to something else, then change it back to the original location. Without both strings, the browser doesn't respond because it doesn't see a change in the control source.

Btw, this is not a true back button because it may skip over several sub folders to navigate back to the start point. Also, I abandoned my efforts on .GoBack and .GoForward because they are apparently not supported by my version of VBA (7).
 

Users who are viewing this thread

Back
Top Bottom