title: How to return the value from function
body: <p>How to return the value from function</p>
  
  <p>Code</p>
  
  <pre><code>Private Function LeaveCheck(empid As String)
      Dim rdoRs1 As rdoResultset
      Dim desc As String
      Dim sSQL As String
      sSQL = "Select name from table1 wher empcode = '" &amp; empid &amp; "'"
      Set rdoRs1 = Rdoconn.OpenResultset(sSQL, rdOpenStatic)
      If rdoRs1.RowCount &gt; 0 Then
      desc = rdors1!name        
      return desc 'Showing error in this line    
      End If
      rdoRs1.Close
  End Function
  </code></pre>
  
  <p>How to return the value from the above code.</p>
  
  <p>Need Vb6 code Help</p>