• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Problem with append using DBGrid

I have a popup menu associated to the DBGrid. When I choose Add item from the menu (righ-clicking on the DBGrib), the append method do not work correctly. If I used the same code but called from a button click, all is fine.

My code:
    SelfSource.DataSet.Append;
    DBEdtNom.Setfocus;
    btnAdd.Enabled := true;

Don<t understand why it don't at one place and not from the other????
0
pjroy
Asked:
pjroy
  • 2
1 Solution
 
MatveyCommented:
Hmmm, please, if it's not so hard, send me the sources to bosism@netvision.net.il
0
 
JaccoCommented:
Tried it and it works fine here...
0
 
pjroyAuthor Commented:
To Matvey:

I sent you a mail with my source!
Thanks a lot
0
 
MatveyCommented:
Seen the project, and for anybody elese interested:

The problem is in the sequence of the commands.

Now you have these lines of code:

  SelfSource.DataSet.Append;
  DBEdtNom.Setfocus;
  btnAdd.Enabled := true;

Just exchange the two first lines:

  DBEdtNom.Setfocus;
  SelfSource.DataSet.Append;
  btnAdd.Enabled := true;

Cheers everybody
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now