Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Navigator
Message
 
À
29/01/2001 16:46:45
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00469698
Message ID:
00470011
Vues:
36
I gave you an example of how I would rewrite the code you posted. So, you should know better where this code is located. The main idea of my proposal is:
while refreshing do not loose your work area and/or current record.

Hope this will help.


>>>>>>>>>>>>>>>>Previous messages below

WHERE would that go? In the ClickEvents of all of the buttons (to ensure it is working)? I was hoping not having to repeat the coding (copy/paste it all over) or use it as a function? I have a parent table (person) and the child table (auth) is in the grid, with the relationship active.

Chuck

>I can not see anything wrong in the code, except:
>1. if you use 'auth' to display something on the form, then you move pointer to the auth's bottom while refreshing. If 'person' related to 'auth', then you move pointer in 'person' too.
>2. if you were sitting on table/cursor other than 'person', then after refreshing you change the work area.
>
>I would add some lines to ensure the environment is recreated. Something like this could work (I do not details of your environment, so here could be some variations):
>
>Local lnsele, lnrec,lnauthrec
>lnsele=sele()
>lnrec=recn()
>SELECT auth
>lnauthrec=recn()
>COUNT FOR person.id = auth.id TO ct
>go (lnauthrec)
>if... * your next code here
>endif
>sele (lnsele)
>go (lnrec)
>
>Best wishes
>
>
>
>>>>>>>>>>>>>>>>>Previous messages below
>SELECT auth
>COUNT FOR person.id = auth.id TO ct
>SELECT person
>IF ct > 0
>ThisForm.Commandgroup2.Command2.ENABLED = .T. (via, the Edit button)
>ThisForm.Commandgroup2.Command3.ENABLED = .T. (via, the Delete button)
>ELSE
>ThisForm.Commandgroup2.Command2.ENABLED = .F.
>ThisForm.Commandgroup2.Command3.ENABLED = .F.
>ENDIF
>
>I thought this was working for a while, but appearly I must have over looked or something else allowed it or whatever. This coding was in the GRID's Refresh. As to my best understanding, maybe it wasn't supposed to be in the Refresh, so where should this be at? This is for to check if there is any records in the CHILD while the PARENT is active. This being said, I also have the 'Add' button (which would be the ThisForm.Commandgroup2.Command1) and upon/after the record is saved (in the child table), I would need to enable those two button as well, so this is why I have the code like this... can you help me with this?
>
>Chuck
>
>>It seems you are loosing the proper work area.
>>Try to use debug to see what is the alias(), and on what line you get an error.
>>You may do it by adding 'set step on' in the very beginning of the code you dispayed here.
>Today is tomorrow's yesterday.
Today is tomorrow's yesterday.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform