Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Navigator
Message
From
29/01/2001 16:46:45
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00469698
Message ID:
00469979
Views:
27
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform