Hola.
Voy a probar eso que me dices:
Esta es la forma como lo tengo
Código Delphi
[-]procedure TForm3.BitBtn4Click(Sender: TObject);
begin
if radioButton1.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A1 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton2.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A2 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton3.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A3 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton4.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A4 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton5.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A5 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton6.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A6 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton7.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A7 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton8.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A8 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton9.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES,MATRICULA,CLAVE,A9 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
if radioButton10.Checked = true then
begin
with datam.Query1 do begin;
close;
sql.Clear;
sql.Add('select NOMBRES, MATRICULA,CLAVE,A10 from 20092');
sql.Add('where clave ='+quotedstr(combobox1.Text));
sql.Add( 'order by nombres asc');
open;
edit;
end;
end;
end;
Y esta funcionando.
Lo que se ve es muy largo, pero eso es lo que tengo.
Saludos..