Object Does Not Support this Property or Method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scubahood
    New Member
    • Feb 2009
    • 2

    Object Does Not Support this Property or Method

    I have a similar question to the OP. I currently have a form "bills" that has two subforms billsupper and billslower. When the main form loads the upper subform is visible and the lower one is not. When you double click on the one of the records on billsupper i then make billslower visible and then try to update the record source based on which one was clicked but i get the same object error.
    Code:
    Private Sub BillShtName_DblClick
    Forms!frmBills!sfmBillsLower.Visible = True
    
    strBillType = Me.BillType
    
    Forms!frmBills!sfmBillsLower.RecordSource = "SELECT BillsFormLower.* FROM BillsFormLower WHERE (((BillsFormLower.BillType)='" & strBillType & "'));"
    end sub
    Last edited by NeoPa; Feb 21 '09, 03:54 PM. Reason: Please use the [CODE] tags provided
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32662

    #2
    Scuba,

    Welcome to Bytes!

    I have moved your post to it's own thread as it's not a part of the previous one (as that is fully answered, and you don't have a solution, it can't be).

    To move forward, I think it may help to know which line the error occurred on. I have assumed from the limited information in your post that the error message text is is the same as I've used for the subject of the thread. If this is not the case then please post that too.

    I did have a scan over the code first but didn't see anything that would obviously cause that error by the way.

    Comment

    • DonRayner
      Recognized Expert Contributor
      • Sep 2008
      • 489

      #3
      At first glance is looks like line 6 should be changed to this. Notice I added .Form before the .RecordSource

      Code:
      Forms!frmBills!sfmBillsLower.Form.RecordSource = "SELECT BillsFormLower.* FROM BillsFormLower WHERE (((BillsFormLower.BillType)='" & strBillType & "'));"

      Comment

      • scubahood
        New Member
        • Feb 2009
        • 2

        #4
        This worked! Thanks so much for your help

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32662

          #5
          Referring to Items on a Sub-Form may be helpful then.

          Comment

          • DonRayner
            Recognized Expert Contributor
            • Sep 2008
            • 489

            #6
            Originally posted by scubahood
            This worked! Thanks so much for your help
            You're welcome, glad I could help. Please do take the time to check out the link that NeoPa supplied.

            Comment

            Working...