Solved

'Invalid value for field' Error

Posted on 2004-03-22
1
1,316 Views
Last Modified: 2012-05-04
I have a form that access a table through a TADOQuery control which has its contents edited through a Data Grid.

It was working fine until I added a calculated field to the TADOQuery and inserted code in its OnCalcFields event like this...

with ADOQUERYTABLEX do begin

      ADOQUERYTABLEXnewfield.Value
      :=  FieldByName('FIELDY').Value * FieldByName('FIELDZ').Value ;

end;

Now whenever I try to assign any values to the table's other fields, the following exception is raised.

"Invalid value for field 'FIELDX' "

Whats going on?
0
Comment
Question by:ziche
1 Comment
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 10647883
if fieldy or fieldz is null such error may raised

replacement

      ADOQUERYTABLEXnewfield.asFloat
      :=  FieldByName('FIELDY').asFloat * FieldByName('FIELDZ').asFloat ;

meikl ;-)

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question