M
Max Moor
Hi All,
I've started using listviews, and it occurred to me to put some
functions that I'll use regularly in a class module. (ie, FillList,
DeleteCurrentItem, etc.) I'm in Access 2002. I inserted the new class
module, named it MyListView, and declared within it the variable:
Private mobjListViewRef As Object
This is intended to be a reference to the listview for the methods to
operate on. I have properties to go with it:
Public Property Get ListViewRef() As Object
ListViewRef = mobjListViewRef
End Property
Public Property Let ListViewRef(pobjListViewRef As Object)
Set mobjListViewRef = pobjListViewRef
End Property
Now, I have a form with a listview. In it's declaration section I
declared:
Private mobjMyListView As MyListView
In the form's Load event code, I have the lines:
Set mobjMyListView = New MyListView
Set mobjMyListView.ListViewRef = Me!lvContacts.Object
Thanks to Alex for getting me this far. Unfortunately, I still get an
"Object variable or With block variable not set" error on the second of
these lines. It acts like the first, instanciation line isn't working.
As far as I can tell, I do these exact same things setting up another
class module I've put together. Does it have something to do with the
various object reference? Do I have to do something more in the class
module itself? Any other ideas?
Regards,
Max
I've started using listviews, and it occurred to me to put some
functions that I'll use regularly in a class module. (ie, FillList,
DeleteCurrentItem, etc.) I'm in Access 2002. I inserted the new class
module, named it MyListView, and declared within it the variable:
Private mobjListViewRef As Object
This is intended to be a reference to the listview for the methods to
operate on. I have properties to go with it:
Public Property Get ListViewRef() As Object
ListViewRef = mobjListViewRef
End Property
Public Property Let ListViewRef(pobjListViewRef As Object)
Set mobjListViewRef = pobjListViewRef
End Property
Now, I have a form with a listview. In it's declaration section I
declared:
Private mobjMyListView As MyListView
In the form's Load event code, I have the lines:
Set mobjMyListView = New MyListView
Set mobjMyListView.ListViewRef = Me!lvContacts.Object
Thanks to Alex for getting me this far. Unfortunately, I still get an
"Object variable or With block variable not set" error on the second of
these lines. It acts like the first, instanciation line isn't working.
As far as I can tell, I do these exact same things setting up another
class module I've put together. Does it have something to do with the
various object reference? Do I have to do something more in the class
module itself? Any other ideas?
Regards,
Max