Hello experts,
I am trying to build a control on a form in access on the fly. Here is the code segment:
Form1 is created in my db, but the control is not built completely (correctly) as a WebBrowser control. It is not enabled and does not contain all of the properties inherent to a WebBrowser control.
When I run ?Forms(0).Controls(0).ControlType, the value retrieved is 119. This is the control type for what looks like all other (extended control types) available in Access based upon the references selected (wb controls, rich text boxes, et al).
I have messed with .OLEData and assigned an existing (manually created) WebBrowser control's properties to the new one that I create with code, but this sort of defeats the purpose of building it on the fly.
Is there another constant that I need to use to refer to the actual WebBrowser (wb) control? Is there a way to store OLEData from an existing wb control that I could assign to the dynamically created template?
thanks guys,
Ben
I am trying to build a control on a form in access on the fly. Here is the code segment:
Code:
Dim ctlNew As Access.Control
'********************************************
' add web browser control in details section.
' a.) OLE Class: Microsoft Web Browser
' b.) Class: Shell.Explorer.2
'********************************************
Set ctlNew = CreateControl(frmNew.Name, acCustomControl, acDetail)
With ctlNew
.OLEClass = "Microsoft Web Browser"
.Class = "Shell.Explorer.2"
.Verb = 0
.Visible = True
End With
Form1 is created in my db, but the control is not built completely (correctly) as a WebBrowser control. It is not enabled and does not contain all of the properties inherent to a WebBrowser control.
When I run ?Forms(0).Controls(0).ControlType, the value retrieved is 119. This is the control type for what looks like all other (extended control types) available in Access based upon the references selected (wb controls, rich text boxes, et al).
I have messed with .OLEData and assigned an existing (manually created) WebBrowser control's properties to the new one that I create with code, but this sort of defeats the purpose of building it on the fly.
Is there another constant that I need to use to refer to the actual WebBrowser (wb) control? Is there a way to store OLEData from an existing wb control that I could assign to the dynamically created template?
thanks guys,
Ben