How to return the value from function
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 = '" & empid & "'"
Set rdoRs1 = Rdoconn.OpenResultset(sSQL, rdOpenStatic)
If rdoRs1.RowCount > 0 Then
desc = rdors1!name
return desc 'Showing error in this line
End If
rdoRs1.Close
End Function
How to return the value from the above code.
Need Vb6 code Help
You need to specify your return type.
Here is a link that is a good read for understanding Functions in VB6
EDIT
After reading your comment, I would create a class to store your values.
Then, you can instantiate a new instance of this class inside of your code: