Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with append using DBGrid

Posted on 1998-06-22
4
Medium Priority
?
184 Views
Last Modified: 2012-05-07
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
Comment
Question by:pjroy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Matvey
ID: 1355215
Hmmm, please, if it's not so hard, send me the sources to bosism@netvision.net.il
0
 
LVL 10

Expert Comment

by:Jacco
ID: 1355216
Tried it and it works fine here...
0
 

Author Comment

by:pjroy
ID: 1355217
To Matvey:

I sent you a mail with my source!
Thanks a lot
0
 
LVL 3

Accepted Solution

by:
Matvey earned 40 total points
ID: 1355218
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question