>>Try doing a LOCATE in the .Refresh() after severing the relation.
>
>Just tried that, but still no good. :-/
>
>>Another approach would be to use a parameterized view for each of the child grids, queried on the appropriate value from the parent table. To show all records you requery on parameter = .NULL.
>
>I thought about doing that, but I thought I could do something real simple. This is just a in-house work application that only I will be using and I didn't want to spend a lot of time on.
>
>Thanks!
Ok, you drove me nuts with this one so I had to poke at for awhile! I set up a test situation with two grids that showed clients (parents table) and accounts (child table). I did a SET RELATION TO in the form's .Init() code, then placed code in a command button's .Click() to remove the relation. After tinkering, here's what I had to do to show all accounts after the relation was broken:
select clients
set relation to
select accounts
use
use accounts in 0 shared
THISFORM.grdAccounts.RecordSource = "accounts"
THISFORM.grdAccounts.Refresh()
The trick was to reset the .RecordSource of the child grid. When an alias used as a .RecordSource is closed, the grid loses the reference.
Now I can sleep tonight!
-Henry-