Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1004
  • Last Modified:

Access VBA: Click link for webbrowser naviation

I can't seem to get the syntax to work to InvokeMember click a link on a web page within the ActiveX WebBrowser object.

The WebBrowser is linking to a page that lists a series of records.  My program searches the body of the page, performs some actions, and then I want it to click the "Next" link at the bottom and start over again on the next page.  The title of the link is "Next Page".

Can you please provide syntax, including any necessary references, to click the "Next Page" link?

Thanks.
0
Phish_Head
Asked:
Phish_Head
  • 5
  • 2
  • 2
1 Solution
 
rajaamirapuCommented:
Get the document from webbrower. Include html library and iterate throgh all the links. In the links you will get your link. Navigate to that link by calling the Browser.navigate
Hope this helps
0
 
Phish_HeadAuthor Commented:
I'm unable to find full syntax to loop through the available links.  Can you please provide the code?
0
 
rockiroadsCommented:
Another way possibly is to embed the datasheet view of a query in a form (datasheet view of a form essentially with the form's recordsource being the query). The form has properties like allowedits etc.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rockiroadsCommented:
My bad, wrong thread! doh!
0
 
rockiroadsCommented:
Ok, now I am on your thread.

From my understanding you have a webbrowser control
This has many links to it but the one you are interested in is titled Next Page
You want to find this and navigate to whatever that is?

Right assuming you had a control called webie. We get the list of links, find Next Page and navigate to that url



Dim htmldoc As HTMLDocument
    Dim htmllinks As HTMLAnchorElement
    
    Set htmldoc = webIE.Document
    For Each htmllinks In htmldoc.Links
        If htmllinks.innerText = "Next Page" Then
            webIE.Navigate2 htmllinks.href
            Exit For
        End If
    Next

Open in new window

0
 
rajaamirapuCommented:
Here webIE is the webbrowser control
0
 
Phish_HeadAuthor Commented:
I meant to allocate the points to rockiroads
0
 
rockiroadsCommented:
I did wonder about the accepted solution until I saw your last post. You can post a question in community support to get this corrected. For PAQness sake it would be good to show the accepted solution.
0
 
rockiroadsCommented:
sorry, forgot to give you the link read this when things go wrong http://www.experts-exchange.com/help.jsp#hs=29&hi=409
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now