Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error on second run of form
Message
From
12/11/2007 16:04:35
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Error on second run of form
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01268563
Message ID:
01268563
Views:
62
Got an interesting one here. I have a form with a Find button. The Find button calls a search form, which lets the user filter data based on various criteria and shows the records matching the criteria in a grid.

The first time the Find button is clicked, everything works as expected. The second time, I get error 2005 with this message:

Error loading file - record number 7. Header1 (or one of its members). Parent : Object class is invalid for this container

The record in question is the header for the first column of the grid.

Items of note:

1) The cursor beneath the grid is created in the search form's Load method.

2) The search form is based on a form class and the grid is a member of that class. In the search form itself, I set ColumnCount and the ControlSources of the various columns.

3) Because of #2 (particularly the grid belonging to the form class), there is no record in the SCX for the grid itself, but there are records for the headers and textboxes that are in the grid.

4) I tried changing the grid.ColumnCount to 1 in the form class, but it didn't change the result.

Thoughts, anyone? (Now I remember why I use grids so rarely.)

Tamar
Next
Reply
Map
View

Click here to load this message in the networking platform