Solved

DBGrid is inactive after adding a record (Delphi 1)

Posted on 1997-12-11
6
229 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
[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
  • 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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

623 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