Access 2007
I am trying to set a property in my class module an MSForms listbox control (lstItemLinks) on my user form, but the listbox shows as null when I run the code. Why is the listbox NULL? It works fine when I code the list box from the form module. All of the other controls are access controls so they reference just fine. I would like to use an MSForm.ListBox instead of an Access.Listbox if it is possible.
-Joshua
If it's not broken, it doesn't have enough parts yet.
I am trying to set a property in my class module an MSForms listbox control (lstItemLinks) on my user form, but the listbox shows as null when I run the code. Why is the listbox NULL? It works fine when I code the list box from the form module. All of the other controls are access controls so they reference just fine. I would like to use an MSForm.ListBox instead of an Access.Listbox if it is possible.
Code:
Set clsLinks = New clsLinkManager
With clsLinks
Set .tabMenu = tabLinks
Set .cmdDelete = cmdDeleteLink
Set .cmdOpen = cmdOpenLink
Set .cmdNew = cmdNewLink
Set .cmdLink = cmdLinkExisting
[highlight]Set .lstLinks = lstItemLinks[/highlight]
Set .txtLinkID = txtLinkID
Set .cboLinkType = cboLinkType
.LoadControls
End With
Code:
Public Property Get lstLinks() As CustomControl
Set lstLinks = plstItems
End Property
[highlight]Public Property Set lstLinks(ListBox As CustomControl)[/highlight]
Set plstItems = ListBox
End Property
Public Property Get cmdOpen() As Access.CommandButton
Set cmdOpen = pcmdOpen
End Property
Public Property Set cmdOpen(CommandButton As Access.CommandButton)
Set pcmdOpen = CommandButton
End Property
-Joshua
If it's not broken, it doesn't have enough parts yet.