Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

how to put totals in DBEdit box pls HELP

i'm new in delphi programming i've been trying to figure out how to put my totals with a comma separator example(1,233.00) using DBEDit box i have this following data Num1, Num2, Totals: Integer and i have a database name testing.db with the ff. fields n1= integer, n2=integer and total=integer i would appreciate any help that you can give me thank you very much...



Comments

  • zibadianzibadian Member Posts: 6,349
    : i'm new in delphi programming i've been trying to figure out how to put my totals with a comma separator example(1,233.00) using DBEDit box i have this following data Num1, Num2, Totals: Integer and i have a database name testing.db with the ff. fields n1= integer, n2=integer and total=integer i would appreciate any help that you can give me thank you very much...
    :
    :
    :
    :
    Specify which datasource and datafield to use in the properties of the TDBEdit. And in the properties of the TDataSource specify the correct dataset. Once you did this the totals should be shown.
  • bogypointsbogypoints Member Posts: 2
    : : i'm new in delphi programming i've been trying to figure out how to put my totals with a comma separator example(1,233.00) using DBEDit box i have this following data Num1, Num2, Totals: Integer and i have a database name testing.db with the ff. fields n1= integer, n2=integer and total=integer i would appreciate any help that you can give me thank you very much...
    : :
    : :
    : :
    : :
    : Specify which datasource and datafield to use in the properties of the TDBEdit. And in the properties of the TDataSource specify the correct dataset. Once you did this the totals should be shown.
    :

    Thanks for your reply!!!

    this is what i did my table is connected to my database then datasource is connected to my table then i have dbedit1 = n1, dbedit2 = n2 and dbedit3 = totals

    i have this formula encoded dbedit3 := dbedit1 + dbedit2;
    so whenever i put some data in dbedit1 and dbedit2 the totals should appear in dbedit3 automatically could you give some recommendations tnx a lot for your help...
  • zibadianzibadian Member Posts: 6,349
    : : : i'm new in delphi programming i've been trying to figure out how to put my totals with a comma separator example(1,233.00) using DBEDit box i have this following data Num1, Num2, Totals: Integer and i have a database name testing.db with the ff. fields n1= integer, n2=integer and total=integer i would appreciate any help that you can give me thank you very much...
    : : :
    : : :
    : : :
    : : :
    : : Specify which datasource and datafield to use in the properties of the TDBEdit. And in the properties of the TDataSource specify the correct dataset. Once you did this the totals should be shown.
    : :
    :
    : Thanks for your reply!!!
    :
    : this is what i did my table is connected to my database then datasource is connected to my table then i have dbedit1 = n1, dbedit2 = n2 and dbedit3 = totals
    :
    : i have this formula encoded dbedit3 := dbedit1 + dbedit2;
    : so whenever i put some data in dbedit1 and dbedit2 the totals should appear in dbedit3 automatically could you give some recommendations tnx a lot for your help...
    :
    I would code the Totals as a calculated field based on n1 and n2. This way, when the user edits DBEdit1 or DBEdit2, he edits n1 and n2, which in turn will change the total. Changing the value of a TDBEdit will not help, because the next update of the database will invalidate that change.
  • iitiit Member Posts: 6
    var s: string;

    s:= IntoStr(StrtoInt(DBEdit1.Text) + strtoint(DBEdit2.Text));
    DBEdit3.Text:= s;


  • zibadianzibadian Member Posts: 6,349
    : var s: string;
    :
    : s:= IntoStr(StrtoInt(DBEdit1.Text) + strtoint(DBEdit2.Text));
    : DBEdit3.Text:= s;
    :
    :
    :
    Setting the DBEdit3 to a variable value won't help, because with the next update from the DBE, the value will be changed again to the value of the linked field. This code would work with normal edits, but not with database edits.
Sign In or Register to comment.