Solved

DBGrid is inactive after adding a record (Delphi 1)

Posted on 1997-12-11
6
224 Views
Last Modified: 2010-04-04
I add a record to a Table. After returning from edit form to the form where is a DBGrid which displays that table the DBGrid is inactive. I cannot move the pointer, I cannot choose any record. If I click on any other table control (let's say the control which displays memo from the same table), DBGrid gets active again.
This strange behaviour is observed only when the number of records is greater than the number of rows in the DBGrid.
There is a query set on that table (I use Luxent Apollo database engine), but I do not know if that is relevant.
0
Comment
Question by:shrldu
  • 3
  • 3
6 Comments
 

Author Comment

by:shrldu
ID: 1353408
Adjusted points to 200
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1353409
? Can you display some code?
Do you deactivate the table when you go out of that window?
? More information is always welcome...
0
 

Author Comment

by:shrldu
ID: 1353410
The code is as follows:

FormUchwaly.Enabled := False;   { first form }
Screen.Cursor := crHourglass;
FormEdUchwaly := TFormEdUchwaly.Create(Application);   { second form, where I do edition with  Insert  or Edit, then I post)
Screen.Cursor := crDefault;;
FormEdUchwaly.ShowModal;
FormEdUchwaly.Free;
FormUchwaly.Enabled := True;
FormUchwaly.Show;
FormUchwaly.Refresh;
{Apollo query is set on the table which is connected with the grid below}
DBGridUchwaly.Refresh;   {DBGrid which makes the trouble}

I deactivate the table connected to DBGridUchwaly only when I close the first form, FormUchwaly.

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 8

Expert Comment

by:ZifNab
ID: 1353411
I don't really know, but I don't think it's necessary to deactivate your first form (it happens automatically). You use also showmodal that automatically only let keyboard input to that form, you have to close this form before you can continue) So you can leave
 FormUchwaly.Enabled := false
 FormUchWaly.Enabled := True
 FormUchWaly.Show;

out of your code.

 FormUchWaly.Refresh needed?

(Don't think this has something to do with your problem, but who knows?)

 What does Apollo does when it activates a query?

I'm sorry, but this is the only way I see I could help you (just proposing some things & asking questions)

Give a sign...
0
 

Author Comment

by:shrldu
ID: 1353412
It's amazing, but when I deleted:
FormUchwaly.Enabled := false
and
FormUchWaly.Enabled := True
my problem disappeared!
So I undestand that you solved my problem. But why on the earth it behaves like this? Do you have any comment on this?  Anyway, just put it as your anwer and I will accept your response.
Thank you very much for your help!
Greetings from a physicist to a physicist <G>.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1353413
Great! But why it reacts like that, I really don't have a clue! Maybe when the form is deactivated the grid also deactivates and isn't activated when the form is activated... Or something like that. Strange though...
Well the problem is solved and that's the first important thing.

To be correct : Delete following lines of code, because they are not relevant (not needed) :

FormUchwaly.Enabled := false
FormUchWaly.Enabled := True

But the problem needs some better look, (when we've got some spare time offcourse!)

C.U. Zif.
 
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

930 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now