Rich is more than on the right track.,, Use the pointer to the datawindowchild to change to the datawindow object.
// original dddw d_adm_commlog_reason
IF g_str_user.s_role_name = 'STAFF' then
l1 = dw_1.GetChild("reason", idwc_reason)
if l1 < 0 then return
idwc_reason.dataobject = 'd_adm_commlog_reason_csr'
idwc_reason.SetTransObject ( SQLCA )
idwc_reason.Retrieve ()
END IF