Solved

DataModule and Exception 'Cannot Focalize invisible Windows'

Posted on 1997-06-23
7
248 Views
Last Modified: 2010-04-04
In Delphi 2 i use the DataModule.
 In my tables i have fields which require value so i don't
 need to write a control and exception code to test if
 a value is present. it's "automatic" !!!
But when a valu miss i have this exception message 'cannot focalize invisible windows'
(it is a translation the message is in French Langage)

Hello... I Try your solutions but the exception event seemed raised BEFORE the OnValidate Event
(I Try to put a break at the top of this procedure with the key F5 but the
exception event raised before this.
0
Comment
Question by:F268
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 2

Expert Comment

by:icampbe1
ID: 1337673
The existing event handler is not doing what you want.  You do not need to write a control to  solve this.  Just supply an OnValidate proc for the field.  It doesn't have to do much... Put up a dialog box maybe, set a default value, or whatever.   OR!!  Trap the execption  (whatever one gets raised)  TRY ... EXCEPT ON Exception DO BEGIN Showmessage('Field missing'); {do whatever} END; END;

0
 

Author Comment

by:F268
ID: 1337674
Edited text of question
0
 

Author Comment

by:F268
ID: 1337675
Hello iCampbe1. I try your solutions and i put a break
(with the key F5) but the exception event seemed arrived BEFORE
the OnValidate Procedure.....


0
Technology Partners: 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!

 
LVL 2

Expert Comment

by:icampbe1
ID: 1337676
You must first of all determine exactly where the exception is being raised.  Use TRY... EXCEPT and increase the scope of this TRY EXCEPT until you have captured the exception.  Once you have determined this, then you know what problem you are fixing.
0
 
LVL 1

Accepted Solution

by:
Gabor earned 50 total points
ID: 1337677
I think the editing form is closed before calling the table post method.
You have to call this method directly from your editing form before it is closed, before the form's controls become invisible.

If it doesn't work write down the situation more detailed, maybe I can help you.

0
 

Author Comment

by:F268
ID: 1337678
Sorry but with the DataModule i don't closed the form. it's the special form of Delphi 2 where you can put all the VCL which are non visual object for user (table, datasource,...) and this special 'form' don't have close evenement.

0
 
LVL 1

Expert Comment

by:Gabor
ID: 1337679
It would be good to describe the flow of your task, because I tought that there is a Form with controls to edit the fields of the table.

So?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run video youtube webbrowse 10 73
Delphi Yen format 3 61
SUM 2 INTEGER ARRAYS INTO 1 10 111
Adoquery sql  left join does not work 25 104
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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