----- Original Message -----
Sent: Tuesday, October 15, 2002 10:44 AM
Subject: Re: [DUG]: Cannot focus a disabled or invisible
window
----- Original Message -----
Sent: Tuesday, October 15, 2002 10:37
AM
Subject: Re: [DUG]: Cannot focus a
disabled or invisible window
well, i tried to set form.activecontrol to
another button, i still get these errors
----- Original Message -----
Sent: Tuesday, October 15, 2002 9:45 AM
Subject: Re: [DUG]: Cannot focus a disabled or invisible
window
This is a guess (I haven't time to test it
out) - the button which is currently active (ie running the code) is
attempting to focus itself following the code execution.
Even though you have set focus elsewhere, the
button is trying to set focus following the execution of the
code...
Regards
Paul McKenzie
Analyst Programmer
SMSS Ltd.
----- Original Message -----
Sent: Tuesday, October 15, 2002 9:39
AM
Subject: [DUG]: Cannot focus a disabled
or invisible window
Hi there...
I have a form with a DBGrid showing values from
one table (tblCompany)
I am currently trying to provide new
record/edit functionality with code, rather than use one of those ugly
DBNavigators.
My problem is with the edit. I have an
edit button displayed always, when the user selects edit, an invisible edit
box is made visible, along with a "save changes" button.
(someone told me once not to allow users to
edit/add within a grid...)
my problem is that when i click save changes i
receive two error messages (the original focus message (subject
line) plus a "dataset not in edit mode" one)
i suspect the focus problem is because i am
making the edit box invisible while focus is still set to it, however i
tried setting focus to another edit box and the error did not
change.
heres the few lines of code i have
tblCompany.Edit;
tblCompany.FieldByName('name').Value
:= txtNewValue.Text;
tblCompany.Post;
txtNewValue.Text :=
'';
txtHoneyPot.SetFocus;
btnSaveEdit.Visible := false;
txtNewValue.Visible :=
false;
please lend me the benifit of your decades of
experience and knowledge here 