Compile Error! Invalid use of property. (Access/VBA Error)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aftab Ahmad
    New Member
    • Jan 2015
    • 49

    Compile Error! Invalid use of property. (Access/VBA Error)

    I am facing the problem with my code. I want to value for "Address" field from another query "PublishersExte nded" which is a combo box through "PublisherI D" field. "PublisherI D" is also a combo box having Row Source from a query "PublishersExte nded". My code is given below.

    Code:
    Private Sub PublisherID_AfterUpdate()
    Me.Address.RowSource "SELECT Address FROM" & _
                " PublishersExtended WHERE ID = " & Me.PublisherID & _
                " Order By ID"
    
    Me.Address = Me.Address.ItemData(0)
    End Sub
    But at event (After Update) on "PublisherI D" an error shown that "Compile Error! Invalid use of Property"

    [IMGnothumb]http://www.mediafire.c om/view/0k5eyq6els440zl/Corel002.jpg[/IMGnothumb]

    Whats wrong with my code? Please somebody help me. Even this code works perfectly on the other forms.

    [IMGnothumb]https://bytes.com/attachments/attachment/8526d1447159129/corel002.jpg[/IMGnothumb]
    Attached Files
    Last edited by zmbd; Nov 10 '15, 10:40 PM. Reason: [z{please note: Third party sites are blocked for many of our experts. Please use the advanced posting option for attachments}{in-lined images}]
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #2
    My guess is an equal sign is missing:
    Code:
    Me.Address.RowSource [iCODE]=[/iCODE] "SELECT Address FROM" & _

    Comment

    • Aftab Ahmad
      New Member
      • Jan 2015
      • 49

      #3
      Thanks jforbes.
      Its working

      Comment

      Working...