Open IE from Access

From http://www.databasejournal.com/features/msaccess/article.php/10895_3505836_2Public

Public Function UpdateOrderInfoWebSite() As Long<br />
On Error Resume NextDim objDoc As SHDocVw.InternetExplorer<br />
Dim sURL As String<br />
Dim lOrderID As Long
lOrderID = Forms!frmOrder!txtOrderID</p>
<p>Const cURL As String ="http://localhost/Orders/Process.asp"<br />
sURL = cURL &#38; "?ID=" &#38; lOrderID<br />
sURL = sURL &#38; "&#38;SDate =" &#38; Forms!frmOrder!txtStatusDate<br />
sURL = sURL &#38; "&#38;SID =" &#38; Forms!frmOrder!cboStatusID<br />
sURL = sURL &#38; "&#38;PONum =" &#38; Forms!frmOrder!txtPONumber<br />
sURL = sURL &#38; "&#38;CID =" &#38; Forms!frmOrder!cboCustomerID</p>
<p>Set objDoc = New SHDocVw.InternetExplorer objDoc.Navigate sURL, , , True</p>
<p>' Need something to pause execution while URL is hit.<br />
Dim i As Integer, j As Integer<br />
For i = 0 To 1000<br />
 j = DCount("*", "MsysObjects")<br />
Next</p>
<p>UpdateOrderInfoWebSite = Err.Number</p>
<p>End Function</p>
<p>Notice that objDoc was declared as type SHDocVw.InternetExplorer? This declaration will fail to compile unless you set a reference to the Microsoft Internet Controls. Open any module and select References from the Tools menu. Scroll down the list until you find the Internet Controls reference and select it.</p>
<p>
Notice that objDoc was declared as type SHDocVw.InternetExplorer? This declaration will fail to compile unless you set a reference to the Microsoft Internet Controls. Open any module and select References from the Tools menu. Scroll down the list until you find the Internet Controls reference and select it.

Share

Leave a Comment