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
 
Tracey
Software Developer / Web Master
Logis
[EMAIL PROTECTED]
(025) 213-1065

Reply via email to