Me.WebBrowser0 on suppliers Field

jeffreylewis

New member
Local time
Today, 22:24
Joined
Sep 17, 2020
Messages
10
Hi

The 429.00 in the code below represents the current price on a suppliers website.
The Me.txtprice_Net is my field on my Access 2007 database
I am at a loss to get the code below to tell me when there has been a change.

Most grateful for any help.

Best Regards
Jeff

Private Sub CmdMMPriceUpdater_Click()
if Me.txtprice_Net = Me.WebBrowser0."&#163;429.00</strong><span class="vat-holder">EX <br />VAT</span></div>" then
MsgBox "No Change", vbCritical, "STOP"
Exit Sub
End Sub
 
There are a lot of things to explain here. First:
1. Can you share the URL where the price can be obtained?
2. How did you make the browser control show you the price?
 
The database has 676 records on a form called frmProductUpdater
As you cycle through the records The browser Control shows the changing pages
The page (The Page shown on the Browser Control) is changed by another field on the frmProductUpdater called txturl

Hope that clarifies
 
Last edited:
Use this code on the DocumentComplete event of your browser control:
Rich (BB code):
Private Sub WebBrowser0_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    If URL <> "about:blank" Then
        Dim doc As Object
        Set doc = Me.WebBrowser0.Object.Document 'if you're using edge browser, remove .Object

        If Me.txtprice_Net = doc.getElementsByTagName("span")(1).innerText Then 'change the 1 with the right number
            MsgBox "No Change", vbCritical, "STOP"
        End If
End Sub

To find the right span number, you can use trial and error.
 

Users who are viewing this thread

Back
Top Bottom