Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot access the selected table.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00187612
Message ID:
00188125
Vues:
25
>>>Hi, Jose,
>>>
>>>Do you know what command is triggering the error message?
>>>
>>>regards,
>>
>>It's a control source error, from controls that do not find their countrol source. In other words, the view gets closed before the control is destroyed.
>>
>Jose,
>
>How about setting autoclosetables to .F. and closing the tables in the release() or unload() event of the form?
>
>regards,

Jim,
Don't know about you, but I have a UIEnabler object added to every page of a pageframe.

The init() of my cPageframe looks like this:
pageframe::Init()
*-- drop an instance of UIEnabler on each page
LOCAL lnIndex
  FOR lnIndex = 1 TO This.PageCount  
  This.Pages(lnIndex).AddObject("UIEnabler1", "UIEnabler")
ENDFOR
The UiEnable() code of my UiEnabler control is:
LPARAMETERS lEnable
IF lEnable  = LockScreen(.T.)  
  This.Parent.Refresh()    
  this.SetFocusToFirst()  
  = LockScreen(.F.)
ENDIF
And the SetFocusToFirst() is:
*-- CHANGE - JCM - November 30, 1997 - 13:04:12
*-- inspiré de eBizObj.SetFocusToFirst()
*-- permet d'avoir le focus sur le premier objet des criètres de recherche
*-- mais sans effet sur les pages de cPageFrame1
LOCAL lnControl, ;   
llRetVal, ;   
lnTabIndex
LOCAL lnControl, ;
	llRetVal, ;
	lnTabIndex

*-- Sets focus to first control that is not disabled
FOR lnTabIndex = 1 TO this.Parent.ControlCount
 FOR lnControl = 1 TO this.Parent.ControlCount
  IF TYPE("this.Parent.Controls(lnControl).TabIndex") <> "U" AND ;
     PEMSTATUS(this.Parent.Controls(lnControl), "SetFocus", 5)
     IF this.Parent.Controls(lnControl).TabIndex = lnTabIndex AND ;
        this.Parent.Controls(lnControl).Enabled 
        this.Parent.Controls(lnControl).SetFocus()
        llRetVal = .T.
        EXIT
      ENDIF
  ENDIF
 ENDFOR
  IF llRetVal
    EXIT
  ENDIF
ENDFOR

RETURN llRetVal
I revisited my errorologs, and it was quite clear that the error was always coming from the first active control, so I simply removed the call to SetFocusToFirst() in the UiEnable() and the .EXE does not exhibit the error anymore. I'll try deeper tomorrow. But this seems to be the solution. Somehow, in Runtime mode, things are a bit different...

And now, tell me how you do your SetFocusToFirst...

José
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform