Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo problem with ControlSource
Message
De
11/07/2008 15:40:48
 
 
À
11/07/2008 15:26:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01330691
Message ID:
01330716
Vues:
20
Ok, my model is this.
I have about 30 containers in my form. each container has a combo box and a data session object that is created in the Init of the container:
WITH Container
.poPrivateDataSession = CREATEOBJECT('FldMaintSession')
.poPrivateDataSession.mSetSession()
.pnDataSession = .poPrivateDataSession.DataSessionId
ENDWITH

DEFINE CLASS FldMaintSession AS Session
DataSession = 2
PROCEDURE mSetSession
SET DELETED ON
SET EXCLUSIVE OFF
ENDPROC
ENDDEFINE

Depends on Data I am showing different number of containers. All the containers are in the form but hidden. I simply make them visible, and when I do I am building data for the Combo and that when it fails. Since each container has its own data I am switching data sessions while I am building multiple containers.

>>>>Here is a fragment of my code:
>>>>
>>>>with someobject
>>>>*!* Populate Item data
>>>>SELECT curItemData
>>>>.txtCustomer.Value = curItemData.customer
>>>>.txtSku.Value = curItemData.sku
>>>>.txQCName.Value = curItemData.fullname
>>>>.pcBarcode = curItemData.barcode
>>>>WITH .cboDefects
>>>> IF EMPTY(.ControlSource)
>>>> TRY
>>>> .ControlSource = 'curItemData.defect_id'
>>>> CATCH TO oErr
>>>> FINALLY
>>>> ENDTRY
>>>> *.ControlSource = 'curItemData.defect_id'
>>>> ENDIF
>>>> .Requery()
>>>>ENDWITH
>>>>endwith
>>>>And here is an error I am getting:
>>>>Alias 'CURITEMDATA' is not found. frmseconds.cbodefects.ControlSource 0
>>>>If it's not found then how come it did not fail in any line above the erroring line?
>>>>
>>>>Thanks for help.
>>>
>>>Did you close the cursor somewhere after this code?
>>
>>No, but I am switching data sessions though. Strange thing is that sometimes it fails, sometime not.
>
>If you switch data sessions for 'prolonged' time then you provoke this error. You may switch data session and return back in the 'next' line, no more. Make sure that you don't call setfocus, activate and any other interface-related methods/events between datasession switch lines.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform