In this video I demonstrate how we can use some simple VBA/JavaScript to interact with the loaded webpage. This video is in answer to several questions I've received in the past several month regarding automating the Microsoft Access Modern Web Browser control.
I cover:
• Retrieving a webpage element's value/text
• Populating the value/text of an element on a webpage
• Submitting a webpage form
• Clicking a webpage button
• Setting the focus to a specific webpage element
EXTRA Info (from the comments):
So the original hard coded code was:
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('sb_form_q').value = 'Microsoft Access Modern Web Browser';"
and say we wanted to pass the value from a form control, we would simply do:
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('sb_form_q').value = '" & Me.YourControlName & "';"
If you want to push a value from a table you could use a recordset:
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('sb_form_q').value = '" & rs!FieldName & "';"
Or use DLookUp():
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('sb_form_q').value = '" & DLooklUp("FieldName", "TableName", "ID=1") & "';"
My Links:
• [ Ссылка ]
• [ Ссылка ]
![](https://i.ytimg.com/vi/OTTQKNuFAFE/maxresdefault.jpg)