Invalid use of Property

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lysander
    Recognized Expert Contributor
    • Apr 2007
    • 344

    Invalid use of Property

    Me again.

    Just added a new combo box to my select form.

    Code:
    Case "HouseEditDouble", "ParentsEditDouble", "ChildEditDouble"
        cboSelectHouse.RowSource = "SELECT HouseID FROM tblHouseDoubleEntry WHERE VillageID = '" & cboSelectVillage & "' ORDER BY HouseID;"
    Case "SchoolEdit"
        cboSchool.RowSource "SELECT SchoolID FROM tblSchoolSurvey WHERE VillageID = '" & cboSelectVillage & "' ORDER BY SchoolID;"
    The line for cboSelecthouse, along with a dozen others, work. The new line, cboSchool, gives a compile error.

    "Invalid use of Property" of cboSelectVillag e

    It is the same code as everywhere else, or have I missed something obvious, like a full stop or something?
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    Have you tried using the value your SELECT statement returns and run it in the SQL window? Everything "looks" OK, but I'd like to see the string generated in line 4.

    Comment

    • Lysander
      Recognized Expert Contributor
      • Apr 2007
      • 344

      #3
      Sadly, this is a compile error, not a run-time error, so I can't even open the form to run it.

      Comment

      • Lysander
        Recognized Expert Contributor
        • Apr 2007
        • 344

        #4
        If you are totally stuffed by a stupid error, give it to a non-programmer.
        "Dear wife, look at these two lines of code, what am I missing"
        "They are both the same Husband dear, except, one has a '=' sign, the other does not"

        Four sodding hours of looking at this, and always looking at the SQL statement, never noticed the missing '='

        Thank you darling wifey.

        Comment

        • twinnyfo
          Recognized Expert Moderator Specialist
          • Nov 2011
          • 3662

          #5
          Your wife is BRILLIANT!! Be sure to tell her!

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #6
            might I also suggest: a hug, a kiss, and take her out for a nice dinner!

            Comment

            Working...