Solved

'Invalid value for field' Error

Posted on 2004-03-22
1
1,299 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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