Gracias eduarcol, coloque un label que me da exactamente lo que quiero. Comprobe que la variable VarEdit silleva el nombre del componente.
Código Delphi
[-]
procedure TPuntodeVentaForm.Button1Click(Sender: TObject);
var
ComponentT : TComponent;
VarEdit : string;
begin
with datamodule2 do
begin
IbQuery3.Close;
IbQuery3.SQL.Clear;
IbQuery3.SQL.Add('Select * from MenuTeclas where Id_Producto <> 0');
IbQuery3.Prepare;
IbQuery3.Open;
if IbQuery3.EOF then
Exit;
IbQuery3.First;
while not IbQuery3.EOF do
begin
VarEdit := IbQuery3.FieldByName('Id_Tecla').AsString;
Label1.Caption := VarEdit; //AQUI EL NOMBRE DEL COMPONENTE
componentT := FindComponent(VarEdit) as TRichEdit;
if Assigned( componentT ) then
begin
with componentT as TRichEdit do
begin
TRichEdit(componentT).Clear;
TRichEdit(componentT).Lines.Add(IbQuery3.FieldByName('Linea1').asString);
TRichEdit(componentT).Lines.Add(IbQuery3.FieldByName('Linea2').asString);
TRichEdit(componentT).Lines.Add(IbQuery3.FieldByName('Linea3').asString);
TRichEdit(componentT).Lines.Add(IbQuery3.FieldByName('Linea4').asString);
end;
end
else
MessageDlg(VarEdit + ' No Asignado', mtwarning,[mbOk],0);
IbQuery3.Next;
end;
IbQuery3.Close;
end;
end;
Me pregunto, no habra que usar FindControl ademas?
sigo pidiendo ayuda.