Ver Mensaje Individual
  #12  
Antiguo 12-03-2010
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Reputación: 25
Caral Va por buen camino
Hola
Recuerda que en tu caso prácticamente todo se repite y que lo que necesitas modificar es solamente el string del SQL, osea, tienes muchas alternativas.
Otra, mas reducida:
Código Delphi [-]
procedure TForm3.BitBtn4Click(Sender: TObject);
var Texto1, Texto2: String;
begin
 Texto1:= 'select NOMBRES,MATRICULA,CLAVE,';
 Texto2:= 'from 20092 where clave = '+quotedstr(combobox1.Text)+' order by nombres asc';
 with datam.Query1 do begin;
 close;
 sql.Clear;

try
if radioButton1.Checked = true then
begin
sql.Text:= Texto1+'A1'+Texto2;
end;

if radioButton2.Checked = true then
begin
sql.Text:= Texto1+'A2'+Texto2;
end;

if radioButton3.Checked = true then
begin
sql.Text:= Texto1+'A3'+Texto2;
end;

if radioButton4.Checked = true then
begin
sql.Text:= Texto1+'A4'+Texto2;
end;

if radioButton5.Checked = true then
begin
sql.Text:= Texto1+'A5'+Texto2;
end;

if radioButton6.Checked = true then
begin
sql.Text:= Texto1+'A6'+Texto2;
end;

if radioButton7.Checked = true then
begin
sql.Text:= Texto1+'A7'+Texto2;
end;

if radioButton8.Checked = true then
begin
sql.Text:= Texto1+'A8'+Texto2;
end;

if radioButton9.Checked = true then
begin
sql.Text:= Texto1+'A9'+Texto2;
end;

if radioButton10.Checked = true then
begin
sql.Text:= Texto1+'A10'+Texto2;
end;

finally
open;
edit;
end;

end;

end.
Y habrán mas opciones, la idea con esto es solamente que aprendamos a dividir un string.
Saludos
__________________
Siempre Novato
Responder Con Cita