Results 1 to 4 of 4

Thread: Type Mismatch

  1. #1

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Type Mismatch

    in my module i have this sub
    Public Sub dothis(tb As TextBox)

    End Sub
    now when i call this in any form using DoThis(aTextBox) it says "type mismatch"

    secondly jus lyk there is a Forms collection using which i can iterate thru all open Forms, i want to know is there a collection regarding the Menu Items of an MDI Form. I want to disable them using something lyke this
    dim mnu as Menu
    For Each mnu in Menus
    mnu.Enabled = false
    Next
    Women ...r like tea bags, you neva know how strong they really r untill u put them in hot water

    Huzefa Yousuf
    Software Engineer
    Verticity Inc.
    +92-345-2235303

    [email protected]

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Type Mismatch

    If you use parentheses you need to use the Call keyword.
    VB Code:
    1. Call dothis(text1)
    If you are not using the Call keyword, then it is just
    VB Code:
    1. dothis text1

  3. #3

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Re: Type Mismatch

    gr8 ! wat abt my other question regarding accessing Menu Items of an MDI Form.
    Women ...r like tea bags, you neva know how strong they really r untill u put them in hot water

    Huzefa Yousuf
    Software Engineer
    Verticity Inc.
    +92-345-2235303

    [email protected]

  4. #4
    Addicted Member Screamager's Avatar
    Join Date
    May 2001
    Location
    Dublin, Ireland
    Posts
    174

    Re: Type Mismatch

    Don't think there is a menu collection. You could use the controls collection though:

    VB Code:
    1. Dim oCtrl As Control
    2.    
    3.     For Each oCtrl In Me.Controls
    4.         If TypeName(oCtrl) = "Menu" Then
    5.             oCtrl.Enabled = False
    6.         End If
    7.     Next
    Computer /nm./: a device designed to speed and automate errors

Posting Permissions

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



Click Here to Expand Forum to Full Width