Solved

Nonsense error

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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