Solved

DBGrid is inactive after adding a record (Delphi 1)

Posted on 1997-12-11
6
223 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
Comment Utility
Adjusted points to 200
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
? 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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

6 Experts available now in Live!

Get 1:1 Help Now