K
kiwi-com
Guest
Attempting to load a web page objects contents from within ACCESS DATABASE FORM.
within ACCESS FORM I inserted
ActiveX Control called "Microsoft WebBrowser" and named it WebBrowser0
two buttons called:-openPage and getobjectvalue
and a TextBox called MyMessage
the code that sits behind them looks like this:-
' on clicking this button the WebBrowser window will load with the page
Private Sub openPage_Click()
Me!WebBrowser0.Navigate "http://localhost/objectpage.asp"
End Sub
' once you have opened the web page clicking this button should achieve the result but I cant get it to work
Private Sub Getobjectvalue_Click()
' Me!MyMessage = Me!WebBrowser0.Document.location ' this works
' Me!MyMessage = Me!WebBrowser0.Document.body.innerHTML ' this works
Me!MyMessage = Me!WebBrowser0.Document.body.myObject.message 'this Fails
End Sub....
Ok hope you are with me so far?
objectpage.asp looks like this!
...........
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
var myObject
myObject = new buildObject("Hello access-programmers!");
function buildObject(message)
{
this.message = message;
this.message2 = "its built!"
}
var myVariable = "hello from A variable"
</script>
</head>
<body>[/I]
Has the Object built? (<script language="javascript">document.write(myObject.message2);</script>)<BR>
<form name="myform1" method="post" action="">
<input name="myfield1" type="text" id="myfield1" value="Hello from a Form">
</form>
</body>
</html>.................
(Yes I know there is no need for an ASP page but it will be when live)
Now the Question is How can I load MyMessage with the contents of MyObject.message
(I managed to load it with "hello from a Form" with
Me!MyMessage = Me!WebBrowser0.Document.myform1.myfield1.value
Any help would be greatly appreciated!
Phew! Thanks in anticipation
within ACCESS FORM I inserted
ActiveX Control called "Microsoft WebBrowser" and named it WebBrowser0
two buttons called:-openPage and getobjectvalue
and a TextBox called MyMessage
the code that sits behind them looks like this:-
' on clicking this button the WebBrowser window will load with the page
Private Sub openPage_Click()
Me!WebBrowser0.Navigate "http://localhost/objectpage.asp"
End Sub
' once you have opened the web page clicking this button should achieve the result but I cant get it to work
Private Sub Getobjectvalue_Click()
' Me!MyMessage = Me!WebBrowser0.Document.location ' this works
' Me!MyMessage = Me!WebBrowser0.Document.body.innerHTML ' this works
Me!MyMessage = Me!WebBrowser0.Document.body.myObject.message 'this Fails
End Sub....
Ok hope you are with me so far?
objectpage.asp looks like this!
...........
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
var myObject
myObject = new buildObject("Hello access-programmers!");
function buildObject(message)
{
this.message = message;
this.message2 = "its built!"
}
var myVariable = "hello from A variable"
</script>
</head>
<body>[/I]
Has the Object built? (<script language="javascript">document.write(myObject.message2);</script>)<BR>
<form name="myform1" method="post" action="">
<input name="myfield1" type="text" id="myfield1" value="Hello from a Form">
</form>
</body>
</html>.................
(Yes I know there is no need for an ASP page but it will be when live)
Now the Question is How can I load MyMessage with the contents of MyObject.message
(I managed to load it with "hello from a Form" with
Me!MyMessage = Me!WebBrowser0.Document.myform1.myfield1.value
Any help would be greatly appreciated!
Phew! Thanks in anticipation