Here is an example of what you need.
'Get the Query to change
Set qdf = dbs.QueryDefs(strQryName)
strQry = qdf.SQL
'Strip out SumOf and replace with empty string
strQry = Replace(strQry, "SumOf", "")
'Add SumOf to field name to align with Table field name
strQry = Replace(strQry, strFind, strReplace)
'Fix the field name the previous replace changed
strQry = Replace(strQry, "zSumOf", "z")
qdf.SQL = strQry
qdf.Close