Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error on second run of form
Message
De
13/11/2007 09:19:41
 
 
À
12/11/2007 16:04:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01268563
Message ID:
01268628
Vues:
18
>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

Are you getting a different result set (different columns) on each run? Try setting the grid.ColumnCount to -1 before the runs.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform