patriciaxxx
Programmer
I'm trying to open a web browser control on an Access 2003 form with an HTML source I create in VBA. The HTML must access some values from a table, so they will need to be variables (I have highlighted them in yellow).
I have the following code.
Problems are:
1. I can't get the code to run from form load event, only from button click event?
2. It doesn't load the html properly, all I can sea is a black box?
3. The string becomes too long, so I have to delete some lines to make it smaller?
4. I don't know how to include the variables?
I have the following code.
Problems are:
1. I can't get the code to run from form load event, only from button click event?
2. It doesn't load the html properly, all I can sea is a black box?
3. The string becomes too long, so I have to delete some lines to make it smaller?
4. I don't know how to include the variables?
Code:
[COLOR=#204A87]Private Sub Form_Load()
Dim HTML As String
HTML = "<html>" & _
"<html>" & _
"<body>" & _
"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" & vbCr & _
" id='player1'" & vbCr & _
" name='player1'" & vbCr & _
" width='480'" & vbCr & _
" height='270'>" & vbCr & _
" <param name='movie' value='player.swf'>" & vbCr & _
" <param name='allowscriptaccess' value='always'>" & vbCr & _
" <param name='bgcolor' value='#000000'>" & vbCr & _
" <param name='flashvars' value='file=../media/[highlight #FCE94F]video.mp4[/highlight]>'" & vbCr & _
" <embed" & vbCr & _
" id='player1'" & vbCr & _
" name='player2'" & vbCr & _
" src='player.swf'" & vbCr & _
" width='480'" & vbCr & _
" height='270'" & vbCr & _
" allowscriptaccess='always'" & vbCr & _
" bgcolor='#000000'" & vbCr & _
" flashvars='file=../media/[highlight #FCE94F]video.mp4[/highlight]'" & vbCr & _
" />" & vbCr & _
"</object>" & vbCr & _
"</body>" & vbCr & _
"</html>"
webBrowser1.Document.write strHTML
End Sub[/color]