lparameter tcNewSource && alias of the new record source if vartype(tcNewSource) <> "C" or not used(tcNewSource) return .f. endif tcNewSource = alltrim(tcNewSource) local lnI local array laColumns[1] with ThisForm.GridName dimension laColumns[.ColumnCount] for lnI = 1 to .ColumnCount if at(".", Columns[lnI]) = 0 laColumns[lnI] = .Columns[lnI].ControlSource else * strip the alias name from the ControlSource laColumns[lnI] = justext(.Columns[lnI].ControlSource) endif endfor .RecordSource = tcNewSource for lnI = 1 to .ColumnCount .Columns[lnI].ControlSource = tcNewSource + "." + laColumns[lnI] endfor endwith