+ Reply to Thread
Results 1 to 4 of 4

Thread: pass control as argument

  1. #1
    Registered User
    Join Date
    05-17-2011
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2007
    Posts
    3

    pass control as argument

    I have several listboxes to maintain, and wrote several routines for various tasks. However Icannot get them to work as intended. I have a function to check whether an item is already in list:
    Function IsInList (InBox as ListBox, CurItem, byref MatchRow as integer) as boolean
    This function resides among other form routines,

    When I call this function

    if isinlist(me.inclbox, curitem, 0atchInd) I get a runtime error of incorrect type or type mismatch.

    The other argument are straightforward, the problem seeems to be the listbox.

    Thank you for any help
    Hakan
    Last edited by horbay; 05-18-2011 at 09:15 AM.

  2. #2
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    409

    Re: pass control as argument

    Try to declare it as MSForms.ListBox

  3. #3
    Registered User
    Join Date
    05-17-2011
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: pass control as argument

    Thank you, this solves the problem. I wish I knew hoto mark your answer as solution.

  4. #4
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    409

    Re: pass control as argument

    To mark your question as solved:
    Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes.

    To rate my answer click on the Scale icon next to the number of my post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0