title: Trying to trouble Object required error in VBA
body: <p>I got this problem.  I have a form that retrieves a table data using the forms' record source property. When the form's opened, I set its record source property to a module's public method RetrieveMembers.  Here's the code below.</p>
  
  <pre><code>Private Sub Form_Open(Cancel As Integer)
  'set Form's record source property to retrieve a Members table
  Me.RecordSource = mod_JoinMember.RetrieveMembers
  
  End Sub
  
  'mod_JoinMember Class
  Public Function RetrieveMembers() As String
  
  Dim strSQL As String
  Set strSQL = "SELECT tbl_Member.Title, tbl_Member.Gender, tbl_Member.LastName, 
  tbl_Member.DateofBirth, tbl_Member.Occupation, tbl_Member.PhoneNoWork, 
  tbl_Member.PhoneNoHome, tbl_Member.MobileNo, tbl_Member.Email, 
  tbl_Member.Address, tbl_Member.State, tbl_Member.Postcode FROM tbl_Member;"
  RetrieveMembers = strSQL
  
  End Function
  </code></pre>
  
  <p><strong>Object required</strong> error is thrown.</p>
  
  <p>I couldn't comprehend this compile error.  I see no wrong with my code since recordsource is a String type property.  And my module's function Retrievemembers is returning a String value.</p>
  
  <p>Why is it that it's not satisfied with this?</p>