You need to use Dynamic SQL to use the Query Gen in this way (if it's even allowed). By dynamic SQL, I mean declaring a long string, setting the string equal to the SQL you want executed, and then execute it. This would be your SQL for this:
DECLARE @SQL VARCHAR(1000)
SET @SQL = 'SELECT blah FROM ' + @tablename
EXEC(@SQL)
Try using the SQL above... it should detect @SQL and @TABLENAME... if it lets you generate this, hook up @SQL to anything (we override it immediately) and @tablename to your table.
I think Query Gen may block this, though... I'd try it and see.