Results 1 to 3 of 3
  1. #1
    mrfrisky330 is offline Novice
    Windows XP Access 2002
    Join Date
    Dec 2017
    Posts
    3

    Can't assign listview to variable?

    For some strange reason Access won't allow me to assign a variable to a listview:



    Dim lvTemp As MSComctlLib.ListView

    Set lvTemp = Me.LVResults


    Returns "type mismatch" error???

    Re-created the database from scratch added the Listview from the activex control list which added reference:
    Microsoft Windows Common Controls 6.0 (SP3) - file: mscomctl.ocx

    The listview works fine no issues adding stuff to it, but everytime I try and assign it to a control (so I can get the HWND of it) I get a "Type Mismatch" error.


    How is this possible if Access adds the reference itself? Also if I just type:

    Dim lvTemp as ListView

    I get the same error message.....!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you dont really have to if you have: Me.LVResults

    why make another copy?

  3. #3
    mrfrisky330 is offline Novice
    Windows XP Access 2002
    Join Date
    Dec 2017
    Posts
    3
    Can't see the HWND property in Access 2000 by just typing LVResults.
    In these older version we need to assign a variable to the Listview in order to see its actual properties e.g. listitems, for some reason Access won't do it!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 08-17-2023, 02:33 AM
  2. Assign variable
    By beaurou in forum Modules
    Replies: 4
    Last Post: 11-21-2014, 12:01 PM
  3. Assign value to variable on other form
    By tylerg11 in forum Access
    Replies: 3
    Last Post: 08-20-2013, 07:48 AM
  4. Replies: 1
    Last Post: 04-25-2013, 02:52 PM
  5. Assign and call variable from table
    By smikkelsen in forum Access
    Replies: 7
    Last Post: 04-01-2010, 09:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums