Código:
CAPA DATOS Public Function BuscarClienteXid(codigo As String) As clsClienteE Dim rs As ADODB.Recordset Dim cli As clsClienteE Dim strSQL As String strSQL = "SELECT cliRuc, cliRazonSocial, cliCiudad, cliDireccion, cliTelefono, cliCelular FROM Cliente WHERE cliCodigo='" & codigo & "'" Set rs = New ADODB.Recordset rs.Open strSQL, cnMDB, adOpenStatic, adLockOptimistic ' If rs.EOF Then Set cli = New clsClienteE cli.cliRuc = Conversion.CStr(rs!cliRuc) cli.cliRazonSocial = Conversion.CStr(rs!cliRazonSocial) cli.cliCiudad = Conversion.CStr(rs!cliCiudad) cli.cliDireccion = Conversion.CStr(rs!cliDireccion) cli.cliTelefono = Conversion.CStr(rs!cliTelefono) cli.cliCelular = Conversion.CStr(rs!cliCelular) ' End If Set BuscarClienteXid = cli End Function CAPA LOGICA Public Function BuscarClienteXid(codigo As String) As clsClienteE objClienteCD.BuscarClienteXid codigo End Function CAPA PRESENTACION Private Sub Form_Load() lblCodigo.Caption = mstrIDCliente If lblCodigo.Caption = "" Then Exit Sub Set objClienteCL = New clsClienteCL objClienteCL.BuscarClienteXid lblCodigo.Caption ' cli = objClienteCL.objClienteId.DataSource Set cli = New clsClienteE txtRuc.Text = cli.CliRuc txtRazonSocial.Text = cli.CliRazonSocial txtCiudad.Text = cli.CliCiudad txtDireccion.Text = cli.CliDireccion txtTelefono.Text = cli.CliTelefono txtCelular.Text = cli.CliCelular End Sub