add a CALL here:
' this try to assign the recordset to rsgrilla passed byRef
CALL remoto.rs_motivo_imp (RsGrilla)
>dim remoto as myapp.myclass
>set remoto = createobject("myapp.myclass","myserver")
>
>dim RsGrilla as ADODB.Recordset
>
>' this try to assign the recordset to rsgrilla passed byRef
>remoto.rs_motivo_imp (RsGrilla)
>
>' and this is my try with a funtion that returns a recordset
>' Set rsgrilla = remoto.rset_motimp
>
>' the past two instructions work well, but I can not use that recordset
>' for exemple to do the next two tasks: show the five records in a msgbox
>' or asociate that recordset with a datacombo object
>
>While RsGrilla.EOF
> MsgBox CStr(RsGrilla("codigo_motivo")) + RsGrilla("descripcion")
> RsGrilla.MoveNext
>Wend
>
>'DCmotivo is a DataCombo object
> Set DCmotivo.RowSource = RsGrilla
> DCmotivo.ListField = "descripcion"
> DCmotivo.BoundColumn = "codigo_motivo"
> DCmotivo.Text = RsGrilla("descripcion")
>
>
>-----------
>'In the com object the function or sub opens the recordset like this:
> rset_motimp.Open "motivoimpresion", conexion, adOpenKeyset, adLockOptimistic, adCmdTable
>' this way is how I try to return the recordset through the parameter
> Set rsparam = rset_motimp
>' the other way is with the name of the function
>' the function is typed this way: ..) as adodb.recordset
>functionname= rset_motimp
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com