Solved

DBGrid is inactive after adding a record (Delphi 1)

Posted on 1997-12-11
6
227 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 104
can't find the executable in Simulator 1 112
Delphi and Access based Enumeration 9 77
Firemonkey DbLookupComboBox equivalent ? 2 66
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 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