rafaelrgl
asked on
GET text from TDBEdit
I would like to get what the user digit on TDBEdit when he´s inserting some field.
Example.
I have some TDBEdit on my form.
The User insert some text on TDBEdit like "RAFAELRGL" when he was inserting.
HOW CAN I GET THAT TEXT.
Example.
I have some TDBEdit on my form.
The User insert some text on TDBEdit like "RAFAELRGL" when he was inserting.
HOW CAN I GET THAT TEXT.
Try checking the value of DBedit.Text in the keyup event of the DBEdit.
also you could do it 2 ways. As stated above and also just in case the user presses the ENTER key to enter the info go to the onkeypress event for that control and use add something like....
var
s: string;
begin
if key=#13 then
s:= dbedit1.text; // Now you can do something with the 's' string. Save it to a file or something.
regards
Elvin
var
s: string;
begin
if key=#13 then
s:= dbedit1.text; // Now you can do something with the 's' string. Save it to a file or something.
regards
Elvin
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also you could do the check in the onExit event of the DBEdit.
Regards
Regards
Haha it seems we are all on the same wave length here !
I suppose if Rafaelrg can give us a more detailed description of exactly what he wants and what sort of application this is then we can give a more detailed response. However, what we have supplied might be ok for his use.
elvin
I suppose if Rafaelrg can give us a more detailed description of exactly what he wants and what sort of application this is then we can give a more detailed response. However, what we have supplied might be ok for his use.
elvin
or in the beforepost event of the dataset directly from the associated tfield . . .
or in the onValidate event of the tfield . . .
or in the inSetText event of the tfield . . .
or . . .
or in the onValidate event of the tfield . . .
or in the inSetText event of the tfield . . .
or . . .
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I WAS CHECKING MY CODE AND THE PROBLEM IS NOT TBEDIT. TBEDIT.TEXT WORKS GOOD. BUT WHEN I TRY TO DO THIS SENTENCE SQL, DOES NOT WORK. THE FIELD IS EMPTY.
If DBTELE.DataSource.DataSet. State = dsInsert then
begin
try
Bd.Query_Clientes_Fone.SQL .Clear;
BD.Query_Clientes_Fone.SQL .Add('inse rt into TB_USER_FONE');
BD.Query_Clientes_Fone.SQL .Add('(IDU SUARIO, TELEFONE, TIPO)');
BD.Query_Clientes_Fone.SQL .Add(' values');
BD.Query_Clientes_Fone.SQL .Add('(' + DBClientes.Fields[0].Text + ',''' + DBETELE.Text + ''',''' + DBETIPO.Text + ''')');
Bd.Query_Clientes_Fone.Exe cSQL;
except
end;
Bd.Query_Clientes_Fone.SQL .Clear;
Bd.Query_Clientes_Fone.SQL .Add('sele ct * from TB_USER_FONE WHERE IDUSUARIO = :ID');
Bd.Query_Clientes_Fone.Exe cSQL;
If not BD.Query_Clientes_Fone.Act ive Then
begin
BD.Query_Clientes_Fone.Ope n;
end;
end else begin
BD.Query_Clientes_Fone.App lyUpdates;
end;
If DBTELE.DataSource.DataSet.
begin
try
Bd.Query_Clientes_Fone.SQL
BD.Query_Clientes_Fone.SQL
BD.Query_Clientes_Fone.SQL
BD.Query_Clientes_Fone.SQL
BD.Query_Clientes_Fone.SQL
Bd.Query_Clientes_Fone.Exe
except
end;
Bd.Query_Clientes_Fone.SQL
Bd.Query_Clientes_Fone.SQL
Bd.Query_Clientes_Fone.Exe
If not BD.Query_Clientes_Fone.Act
begin
BD.Query_Clientes_Fone.Ope
end;
end else begin
BD.Query_Clientes_Fone.App
end;
ASKER
wave length.
DON´T SAY THAT TO OTHER USER ELVIN. I GOT A PROBLEM AND I TRY SO HARD TO MAKE MY CODE WORKS GOOD.
DON´T SAY THAT TO OTHER USER ELVIN. I GOT A PROBLEM AND I TRY SO HARD TO MAKE MY CODE WORKS GOOD.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
>DBETELE.Text
>DBETIPO.Text
This Fields Above.
>DBETIPO.Text
This Fields Above.
ASKER
Thanks, I DID, it is working now. Here is the code:
If DBTELE.DataSource.DataSet. State = dsInsert then
begin
Bd.SQLClientes_Fone.Insert SQL.Clear;
BD.SQLClientes_Fone.Insert SQL.Add('i nsert into TB_USER_FONE');
BD.SQLClientes_Fone.Insert SQL.Add('( IDUSUARIO, TELEFONE, TIPO, PADRAO)');
BD.SQLClientes_Fone.Insert SQL.Add(' values');
BD.SQLClientes_Fone.Insert SQL.Add('( ' + DBClientes.Fields[0].Text + ', :TELEFONE, :TIPO, :PADRAO)');
BD.Query_Clientes_Fone.App lyUpdates;
end;
BD.Query_Clientes_Fone.App lyUpdates;
If DBTELE.DataSource.DataSet.
begin
Bd.SQLClientes_Fone.Insert
BD.SQLClientes_Fone.Insert
BD.SQLClientes_Fone.Insert
BD.SQLClientes_Fone.Insert
BD.SQLClientes_Fone.Insert
BD.Query_Clientes_Fone.App
end;
BD.Query_Clientes_Fone.App
what ? I think you missunderstand my comment but it's probably you poor english so don't worry about it. I'm glad you got it worked out.
Elvin
Elvin