Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Confused about tableupdate....using view in grid
Message
 
To
17/08/1998 16:32:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00127443
Message ID:
00127566
Views:
36
>This is the code I execute when the update all button is pressed:
>
>SELECT grid

When you select the child table, the relationship to the parent is lost (until you select the parent table again).

>GO TOP IN grid

When you GO TOP you're actually going to the first record of the table (in it's current order) regardless of any relationships. Same goes for any of the GO commands

>DO WHILE NOT EOF()
> REPLACE noshow WITH "X"
> SKIP 1 IN grid
>ENDDO

With the above in mind, your looping through the entire table here. Eof() is the end of your table.

There are several ways to do what your trying to do. Not knowing the specifics, I couldn't recomend a particular solution, but here are some options:

- Add a 'for' clause to your replace all to limit the scope of your records.

- Use a parameterized view instead of the child table directly.

- The 'set key' command will limit the table to only those matching the condition. ie: go top now works as you thought it should. Same goes for most other commands such as scan, replace all, etc.
kenweber
GCom2 Solutions
Microsoft Certified Professional

Previous
Reply
Map
View

Click here to load this message in the networking platform