Board index » delphi » On DB error 'Cannot focus...'

On DB error 'Cannot focus...'

Hi,
With D5, using the BDE on a Paradox table...

Problem:  Table POST with an empty required field is generating the
following error message--
'Cannot focus a disabled or invisible window.'

Details:

POST is generating an error when either of two required fields are
empty.
On the second field in the form, it gives the expected:

  'Field xxx must have a value.'

error message when field is left blank.

HOWEVER
  when the first required field is left blank, it generates:

'Cannot focus a disabled or invisible window.'

error message.

Any ideas on what could be inhibiting the error message window?

Thanks,
Al

 

Re:On DB error 'Cannot focus...'


I belive the control linked to the field is either invisible or disabled at
the moment the error occures. (For example it could be on the TabSheet which
is not selected at the moment)

Gert

Quote
> POST is generating an error when either of two required fields are
> empty.
> On the second field in the form, it gives the expected:

>   'Field xxx must have a value.'

> error message when field is left blank.

> HOWEVER
>   when the first required field is left blank, it generates:

> 'Cannot focus a disabled or invisible window.'

> error message.

> Any ideas on what could be inhibiting the error message window?

> Thanks,
> Al

Re:On DB error 'Cannot focus...'


The only time I have seen this was when something in code was trying to set
focus to a control that was invisible or on another page of a PageControl.

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Re:On DB error 'Cannot focus...'


Thanks to both of you.  The same DB field is referenced in DBEdit fields
on two different forms, one of which was inactive.  By
enabling/disabling these DBEdits when appropriate (when their respective
forms are active), the problem is solved.

Al

Quote
"Bill Todd (TeamB)" wrote:

> The only time I have seen this was when something in code was trying to set
> focus to a control that was invisible or on another page of a PageControl.

> --
> Bill

> Bill Todd (TeamB)
> (TeamB cannot respond to questions received via email)

Other Threads