Looks like this thread, you and thread703-478496 are closely related
You can set your recordsource to an SQL statement in code.
To get your base SQL string, open the query in design view, switch to SQL view. You want to get at that string.
So
If you have in the QBE a field1 and newField: field2
selecting from the Table Table your SQL will look something like
Select Field1, Field2 as newField From Table;
Now if you want to substitue a different field to be aliased to new field...
strReporRecordsource = "Select Field1, " & strFieldName & " as newField From Table;"
There is a lot to know about string manipulation but the piece you might not know which may bite you is that to get double quotes into a string, you just use a pair of double quotes...
debug.print "Hello "" World"
will display
Hello " World
in the debug window
debug.print """Hello World """
displays
"Hello World"
debug.print """"
Displays
"
That's got you on your way.