| |

VerySource

 Forgot password?
 Register
Search
Author: zxchy135

dbedit calculation problem

[Copy link]

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-21 12:30:02
| Show all posts
Write this:
if (DBEdit1.Field.IsNull) Or (DBEdit2.Field.IsNull) then
DBedit3.text: = '0'
else dbedit3.Text: = floattostr (strtofloat (dbedit1.Text) * strtofloat (dbedit2.Text));
Reply

Use magic Report

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-21 14:45:01
| Show all posts
You are using DBedit, which is connected with the database fields. See what the field values ​​in the database are,
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 Unknown

 Author| Post time: 2020-3-22 23:00:02
| Show all posts
I clicked adoquery.append after adding data, and he gave an error. Is it empty when I add a new record field?
Reply

Use magic Report

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-23 23:15:02
| Show all posts
Didn't I write the code for you?
Write this:
if (DBEdit1.Field.IsNull) Or (DBEdit2.Field.IsNull) then
DBedit3.text: = '0'
else dbedit3.Text: = floattostr (strtofloat (dbedit1.Text) * strtofloat (dbedit2.Text));
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-3-25 12:15:02
| Show all posts
I wrote it upstairs. Is it related to the data I added to aoquerynewrecord?
Reply

Use magic Report

0

Threads

17

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-3-27 09:00:01
| Show all posts
Use Edit
Reply

Use magic Report

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-27 16:00:01
| Show all posts
Do you still report this error?
Reply

Use magic Report

1

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 South Africa

 Author| Post time: 2020-3-28 00:30:02
| Show all posts
Only use edit
Reply

Use magic Report

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-28 09:45:01
| Show all posts
No problem, I tested it, it's normal,
Reply

Use magic Report

0

Threads

53

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-28 11:30:01
| Show all posts
May be your DBEdit3 is copied from DBedit2, onchange event to see if it is only executed by DBEdit2
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list