Solved

Nonsense error

Posted on 1997-04-14
3
150 Views
Last Modified: 2010-04-06
     Hi. My problem is that I have a form where I show the user the information about the customers in a database. I have added to the form a navigator so the user can click and move in the table. But lastly, I am getting an error I don't understand. It seems that when I first show the form in the program and go to the last record by clicking the navigator's button, I get an error that says: 'Grid Index Out Of Range' ... and I don't have any grids on my form ! My surprise grows when I accept the error, close the form, open it again, go to the last record and then, I don't get the error! It's incredible, but I only get the error the first time I show the form. When I show it the second time and so on, nothing happens with that error. What is wrong with my form ? If I don't use a grid, why do I get that kind of error ?
0
Comment
Question by:sime
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
javiertb earned 60 total points
ID: 1335386
Here you have several options:

-Do not link at definition time more than one form to the same DataSet.

-Before making that call to the last record, set the datasource
Enabled property to false, then set it to True after calling Last record. If you're looping through several records at a time, set the Enabled property prior to entering the loop and reset it after leaving the loop.

-If you have hidden grids (for example on other tab pages) you may get the error when the database gets to the end.  The easiest way to avoid the error is to use the onshow events of the tab pages or forms to enable the grid and the onhide event to disable the grid, this way the error doesn't seem to happen.

Hope this helps
0
 
LVL 2

Expert Comment

by:javiertb
ID: 1335387
Are you going to evaluate my answer or not??
0
 

Author Comment

by:sime
ID: 1335388
Great answer, thanks for all.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

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…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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