Expression is not a Method.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jeann9ne
    New Member
    • Aug 2012
    • 1

    Expression is not a Method.

    Hello,

    I'm experiencing the same problem over and over again and my professor is too busy with other students to help me in most of my labs.
    (I'm not trying to get anyone to do my homework I just need one simple answer.)

    Anyway, I tried to make a module:

    Sub compareArea(ByV al rec1Area As Double, ByVal rec2Area As Double)

    Blah Blah If-Then-Else Statement

    End Sub

    There are no errors until I try to call the module in Main then I get 'Expression is not a method.' I know it isn't a method, I just don't know how to make it into one, someone please help I've put 2 hours of research into this and still no answer.
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    There are some conditions for working with array in functions.
    The array's must have the same datatype,...
    This is a good site with examples for working with array:

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      Post the code here, what is there in module... and also the procedure calling in main program.

      Regards
      Veena

      Comment

      • Rodney Roe
        New Member
        • Oct 2010
        • 61

        #4
        did you declare your sub in the module as public?

        ie...
        Public Sub compareArea()

        Comment

        • john garvey
          New Member
          • Jan 2011
          • 50

          #5
          Hi

          When you state 'I tried to make a module', where have you tried to make the module is it a class module as attached to a form or is it a 'named module' in the visual basic editor ?

          Where and how have you inserted your sub routine ?

          Kind regards

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Your description is kind of vague. It would help if you could provide more specific details of the error. For instance...
            • Does the error occur when compiling or executing the code?
            • Where does compareArea() live - is it in the same module as Main?
            • Where precisely does the error occur? Is it the call from Main to compareArea which gets the error? Or does the error occur somewhere inside compareArea?
            • If you're in the VB IDE, what gets highlighted when the error is reported?
            • Perhaps you're qualifying the name of compareArea in the call? For example "Form1.compareA rea".

            Just keep in mind, in programming the details are crucial.

            Comment

            Working...