Webrowser syntax from URL in Access not loading

A

Adam Thwaites

Hi, I have an MS Access form with a Web Browser in it which is loaded when
the form loads using the following code:
With webHome
.Navigate URL:="G:\ADAM\img\MBIScript.html?TimeOfDay=" & varTimeOfDay &
"&Agent=" & txtAgentSelected
Beep
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
End With

THe webpage uses this code to extract the syntax:

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

This works fine when I load the webpage from another webpage but when it
loads from Access I get Error: 'undefined' is null or not an object.
And the webpage loads up:
Good Morning&Agent, my name is undefined.

How do I fix this? I think it might be a problem with the
var qpairs = document.location.search.substring(1).split("&")
line and the document location with it being inside a Access form but I have
no idea how to fix it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top