Solved

Nonsense error

Posted on 1997-04-14
3
145 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

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

Title # Comments Views Activity
problem when i try to pack my dll file with upx 9 72
delphi exception 7 63
Correct Component for Shopping Cart. 2 96
drawing animated level bar based on numbers 3 88
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…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 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

18 Experts available now in Live!

Get 1:1 Help Now