?
Solved

VBA does not recognize listview intellisense

Posted on 2008-11-05
9
Medium Priority
?
564 Views
Last Modified: 2013-11-28
Hello,

I have a form with various controls, including ListView. When I create an event handler in code, some of the controls aren't recognised, I get no Intellisense menu of the properties, and a 'Object doesn't support this property or method' error when I run the form. The code compiles without any complaint. I've tried 1) re-register the component (MSCOMCTL.OCX), repair the database, repair the Access application, copied the form to another name, copied the form to another Access database, etc.  Nothing worked.  Can anyone help?  P.S. I need to use ListView control.
0
Comment
Question by:COPUSER
  • 6
  • 3
9 Comments
 
LVL 75
ID: 22890933
Do this:

Set the Name property of the ListView control to say ... myListView

Then do this:

Option Compare Database
Option Explicit
Dim myListView As ListView


Private Sub Form_Load()
  Set myListView = lstViewA
  myListView.BackColor = RGB(255, 0, 0)            ' Intellisense will now work here
End Sub

mx
0
 
LVL 75
ID: 22890951
*** SORRY ... typo ... wrong Name .....

*** Set the Name property of the ListView control to say ... lstViewA       .... not myListView
                                                                                      ------^^^^^^^^^^

mx
0
 

Author Comment

by:COPUSER
ID: 22891111
Thanks for quick response, DatabaseMX.

I made the changes you've mentiioned.  Now, I see the intellisense methods and properties.  However, when I run the code, I get the error 'Type Mismatch" error on the line:  

Set myListView = lstViewA

Any suggestions?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75
ID: 22891128
standby ...

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 22891160
Here you go ...


Private Sub Form_Load()
  Set myListView = lstViewA.Object                       ' add dot  Object  
  myListView.BackColor = RGB(255, 0, 0)

End Sub
0
 

Author Closing Comment

by:COPUSER
ID: 31513717
Now that I have put down the fire, can you explain why did this happen?  This is my first time, but will something like this occur more frequently?
0
 
LVL 75
ID: 22891355
"Can you explain why did this happen? "

Why did what happen ?
0
 

Author Comment

by:COPUSER
ID: 22891382
The sudden loss of intellisense for ActiveX components.  Before, you can add an activex control on a form and be able to see the intellisense work right away.  I've read several ExpertsExchange questions that were similar to the problem I was having, but I could not find any definitive answer why.
0
 
LVL 75
ID: 22891418
I have never been able to get it to work other than the way I showed.

mx
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question