Board index » delphi » Wierd Error -- Compiler Bug ?

Wierd Error -- Compiler Bug ?

Hello All --

        I have a written a dBase program in Delphi 2.0, and here is what happens
that is wierd.. I have a form (call it FORM1) and it has a bunch of data
aware controls, including a DBCheckBox. DBCheckBox is associated with the
field "PROOFED". FORM1, along with the other forms in the appliaction are
created when the program runs.  In FORM1 I have an OnClick event for the
DBCHeckBox. Here is where the problem arises.. When I run a different part
of the program, and I read through my database records, when PROOFED
changes from FALSE to TRUE, the OnClick event on FORM1 is called.. This
creates an error message because the end of the OnClick event is a
SETFOCUS command, which it can not execute because the form is not visible
when I am running the other part of the program.

        At the moment, my work around is to check if FORM1 is visible before
proceeding with the OnClick event.. but I would like this not to happen..
Does anyone have any idea what it is happening, and/or has anyone else run
into this kind of problem of their own ?

        Thanks.

Rich Morey
richard.mo...@factory.com

 

Re:Wierd Error -- Compiler Bug ?


In article <01bb57f5.9f47afa0$9d708...@NONE.factory.com>, Richard Morey
<richard.mo...@factory.com> writes

Quote
>Hello All --

>       I have a written a dBase program in Delphi 2.0, and here is what happens
>that is wierd.. I have a form (call it FORM1) and it has a bunch of data
>aware controls, including a DBCheckBox. DBCheckBox is associated with the
>field "PROOFED". FORM1, along with the other forms in the appliaction are
>created when the program runs.  In FORM1 I have an OnClick event for the
>DBCHeckBox. Here is where the problem arises.. When I run a different part
>of the program, and I read through my database records, when PROOFED
>changes from FALSE to TRUE, the OnClick event on FORM1 is called.. This
>creates an error message because the end of the OnClick event is a
>SETFOCUS command, which it can not execute because the form is not visible
>when I am running the other part of the program.

My own solution is to never use the DBCheckBoxes for this very reason -
I can't find a suitable workaround. I think that the OnClick event
should really be called OnChange since that is what it seems to do for
me... In the end I used a normal checkbox and posted the change to the
database myself.

--
---------------------------------------------------------------------
Marc Evans                      m...@leviathn.demon.co.uk

Other Threads